strange empty array behavior being at in_array()
| From: | Peter Vereshagin | Date: | Mon, 24 Dec 2001 06:35:08 +0000 |
| Subject: | strange empty array behavior being at in_array() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78646@lists.php.net to get a copy of this message | ||
I wonder why something non-empty is considered to be an empty array
element:
===
if ( in_array('pattern', array( 0 ) ) )
print "Got it";
===
I got the true condition. However, after I populate the array with
antries other than 0 and ''
the condition fails.
I think that would not be PHP error. But what's the thing I
misunderstood?