note 58340 deleted from function.in-array by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 18:58:07 +0000 |
| Subject: | note 58340 deleted from function.in-array by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134487@lists.php.net to get a copy of this message | ||
Note Submitter: mano at easymail dot hu
----
Note, that in php's comparison table it says "php"==0 is true, so if:
(second table: http://www.php.net/manual/en/types.comparisons.php)
<?php
$foo = in_array(0, array("x", "y")); // foo is TRUE!!!!! AAAH!
?>
because 0 and any string is equal. Of course, 0==="php" is not equal, false, but
0==="0" false too.
nice comparison tables by the way...
.mano