note 57755 added to language.variables
| From: | ludvigdotericsonatgmaildotcom at osu1 dot php dot net | Date: | Thu, 13 Oct 2005 11:33:07 +0000 |
| Subject: | note 57755 added to language.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96943@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/language.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57755
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57755&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57755&report=yes
Search -- http://master.php.net/manage/user-notes.php