note 60162 added to function.in-array
| From: | jeff-php at cyberrodent dot com | Date: | Wed, 28 Dec 2005 14:36:58 +0000 |
| Subject: | note 60162 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100852@lists.php.net to get a copy of this message | ||
$my_array = new Array();
if in_array($stuff, $my_array) ...
will complain with a "wrong Datatype" error - confusing the empty array with something
that is not an array.
PHP Warning: in_array(): Wrong datatype for second argument
this seems to me to be a bug, or at least the wrong text for this message.
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60162
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60162&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60162&report=yes
Search -- http://master.php.net/manage/user-notes.php