note 57755 deleted from language.variables by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 16:02:39 +0000 |
| Subject: | note 57755 deleted from language.variables by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142151@lists.php.net to get a copy of this message | ||
Note Submitter: ludvig dot ericson at gmail dot com
----
On the previous note:
This is due to how evaluation works. PHP will think of it as:
$a = whatever $b = $c is
$b = whatever $c = 1 is
... because an expression is equal to what it returns.
Therefore $c = 1 returns 1, making $b = $c same as $b = 1, which makes $b 1, which makes $a be $b,
which is 1.
$a = ($b = $c = 1) + 2;
Will have $a be 3 while $b and $c is 1.
Hope that clears something up.