Bug #16726: in_array doesnt allow Array as a search argument
| From: | emailleonid at start dot com dot au | Date: | Mon, 22 Apr 2002 04:02:41 +0000 |
| Subject: | Bug #16726: in_array doesnt allow Array as a search argument | ||
| Groups: | php.bugs php.doc | ||
| Request: | Send a blank email to php-bugs+get-5538@lists.php.net to get a copy of this message | ||
From: emailleonid@start.com.au
Operating system: winXP
PHP version: 4.2.0
PHP Bug Type: Documentation problem
Bug description: in_array doesnt allow Array as a search argument
Below is from documentation of in_array()
$a = array(array('p', 'h'), array('p', 'r'), 'o');
if (in_array(array ('p', 'h'), $a))
echo "'ph' is found\n";
if (in_array(array ('f', 'i'), $a))
echo "'fi' is not found\n";
if (in_array('o', $a))
echo "'o' is found\n";
it runs it gice the followign error
Warning: Wrong datatype for first argument in call to in_array in
/home/www/vaner/test.php on line 4
Warning: Wrong datatype for first argument in call to in_array in
/home/www/vaner/test.php on line 6
'o' is found
I thought it should allow array as a search argument.
what the...?
--
Edit bug report at http://bugs.php.net/?id=16726&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16726&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16726&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16726&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16726&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16726&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16726&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16726&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16726&r=submittedtwice