Bug #16726 Updated: in_array doesnt allow Array as a search argument
| From: | yohgaki@php.net | Date: | Mon, 22 Apr 2002 06:09:54 +0000 |
| Subject: | Bug #16726 Updated: in_array doesnt allow Array as a search argument | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-5541@lists.php.net to get a copy of this message | ||
ID: 16726
Updated by: yohgaki@php.net
Reported By: emailleonid@start.com.au
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: winXP
PHP Version: 4.2.0
New Comment:
It works for me. (PHP 4.2.0/4.3.0)
BTW, Paste _COMPLETE_ script, nobody can be sure which line is line 4
or 6.
Previous Comments:
------------------------------------------------------------------------
[2002-04-22 00:02:41] emailleonid@start.com.au
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 this bug report at http://bugs.php.net/?id=16726&edit=1