note 45893 added to function.in-array
| From: | erik_bielefeldt at yahoo dot com | Date: | Wed, 22 Sep 2004 17:08:50 +0000 |
| Subject: | note 45893 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77164@lists.php.net to get a copy of this message | ||
Please note the following ridiculous behaviour:
in_array('test', array(0)) evaluates to true
This is probably related to this behaviour:
0 == 'test' evaluates to true
For some reason, 0 is equivalent to any string.
Not cool.
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45893
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45893&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45893&report=yes
Search -- http://master.php.net/manage/user-notes.php