note 115415 added to control-structures.if
| From: | KonradW | Date: | Mon, 21 Jul 2014 06:34:42 +0000 |
| Subject: | note 115415 added to control-structures.if | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199984@lists.php.net to get a copy of this message | ||
It has been said that an assignment in an if statement always resolves to 'true'. However,
that is only the case if the value being assigned is not null.
if ($a = 1) // will produce true
if ($a = null) // will produce false
----
Server IP: 72.52.91.14
Probable Submitter: 69.171.153.201
----
Manual Page -- http://php.net/manual/en/control-structures.if.php
Edit -- https://master.php.net/note/edit/115415
Del: integrated -- https://master.php.net/note/delete/115415/integrated
Del: useless -- https://master.php.net/note/delete/115415/useless
Del: bad code -- https://master.php.net/note/delete/115415/bad+code
Del: spam -- https://master.php.net/note/delete/115415/spam
Del: non-english -- https://master.php.net/note/delete/115415/non-english
Del: in docs -- https://master.php.net/note/delete/115415/in+docs
Del: other reasons-- https://master.php.net/note/delete/115415
Reject -- https://master.php.net/note/reject/115415
Search -- https://master.php.net/manage/user-notes.php