note 37977 rejected from function.in-array by didou
| From: | didou@php.net | Date: | Fri, 09 Jan 2004 17:13:41 +0000 |
| Subject: | note 37977 rejected from function.in-array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63219@lists.php.net to get a copy of this message | ||
Note Submitter: christopher AT idealab DOT com
----
class Test { }
$b=new Test();
$a=array();
$a[]=$b;
in_array($b, $a);
This gives:
Warning: in_array(): Wrong datatype for first argument
Apparently, you can't search for whether an object instance is already in an array? Pretty
weird!
I saw one pseudo-workaround on this site about using uniqid(), but this seems horribly inelegant.