What is the rationale for Assignment in State alerts in the Zend Studio IDE?

Given:

if ($variable = get_variable('variable')) {
    // ...
}

* $ variable = get_variable ('variable') * issues a "Destination in state" warning in Zend Studio. I understand what this warning means, but does anyone know what is behind this? Are these just coding rules, readability issues, etc.?

+3
source share
5 answers

, IDE/ , : = () == () , if, , , , , , .

+5

, :

if ($variable = get_variable('variable')) {
    // ...
}

:

if ($variable == get_variable('variable')) {
    // ...
}

- . Zend Studio , , , , . , . while, ( ). , .

+3

, , . :

if ($variable = get_variable('variable') != false) {
    // ...
}
0

, "="

if ($a = $b) { /* $a and $b equal? */ }

, IDE .

0

, , = ==.

, , .

if (($var = 1))
{
    /* ... */
}
0

Source: https://habr.com/ru/post/1776316/


All Articles