note 57313 added to function.in-array
| From: | wiseman at noemail dot org | Date: | Fri, 30 Sep 2005 10:06:22 +0000 |
| Subject: | note 57313 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96036@lists.php.net to get a copy of this message | ||
Beware of a bug in PHP 4.3.4 (and possibly other versions):
in_array('some_string', array(0))
returns true! If the array contains the element 0, any string you search will return 0.
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57313
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57313&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57313&report=yes
Search -- http://master.php.net/manage/user-notes.php