note 110172 added to control-structures.if
| From: | Anonymous | Date: | Wed, 26 Sep 2012 11:15:09 +0000 |
| Subject: | note 110172 added to control-structures.if | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191031@lists.php.net to get a copy of this message | ||
to bimal at sanjaal dot com
The result of this comparison is correct. In the first example parser uses type juggling to convert
'13_2' string to integer giving us (int)13 == NUMBER where NUMBER is integer constant of
value 13.
In the second example you convert integer to string and '13' does not match
'13_2'.
If you read 'Type Juggling' chapter carefully it will resolve your doubts.
----
Server IP: 69.147.83.199
Probable Submitter: 178.37.114.149
----
Manual Page -- http://www.php.net/manual/en/control-structures.if.php
Edit -- https://master.php.net/note/edit/110172
Del: integrated -- https://master.php.net/note/delete/110172/integrated
Del: useless -- https://master.php.net/note/delete/110172/useless
Del: bad code -- https://master.php.net/note/delete/110172/bad+code
Del: spam -- https://master.php.net/note/delete/110172/spam
Del: non-english -- https://master.php.net/note/delete/110172/non-english
Del: in docs -- https://master.php.net/note/delete/110172/in+docs
Del: other reasons-- https://master.php.net/note/delete/110172
Reject -- https://master.php.net/note/reject/110172
Search -- https://master.php.net/manage/user-notes.php