|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-26 11:41 UTC] benoit dot ferlet at freesbee dot fr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 12:00:02 2025 UTC |
PHP is reporting a "Wrong datatype for first argument" error when using an object as the needle argument for the in_array() function. The code below will generate the error: <?php class Foo { } $foo = new Foo(); $test = array(1,2,3,4,5); if (in_array($foo,$test)) { print "Yes"; } else { print "No"; } ?>