note 110172 deleted from control-structures.if by googleguy
| From: | googleguy@php.net | Date: | Wed, 10 Oct 2012 20:39:43 +0000 |
| Subject: | note 110172 deleted from control-structures.if by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191247@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
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.