Bug #11893: array_intersect doesn't handle multidimensional arrays correctly

From: Date: Wed, 04 Jul 2001 23:49:53 +0000
Subject: Bug #11893: array_intersect doesn't handle multidimensional arrays correctly
Groups: php.dev 
Request: Send a blank email to php-dev+get-58936@lists.php.net to get a copy of this message
From: michael@zaphod.rhein-neckar.de Operating system: Linux, FreeBSD, OpenBSD (Any?) PHP version: 4.0.6 PHP Bug Type: Arrays related Bug description: array_intersect doesn't handle multidimensional arrays correctly michael@zaphod:~>php <? $a = array(array(1, "a"), array(2, "b"), array(3, "c")); $b = array(array(1, "a"), array(2, "b"), array(4, "d")); $c = array_intersect($a, $b); var_dump($c); ?> X-Powered-By: PHP/4.0.6 Content-type: text/html array(3) { [0]=> array(2) { [0]=> int(1) [1]=> string(1) "a" } [1]=> array(2) { [0]=> int(2) [1]=> string(1) "b" } [2]=> array(2) { [0]=> int(3) [1]=> string(1) "c" } } The same thing happens in 4.0.5. For comparison 4.0.4pl1-Output (and as I expect it to be): X-Powered-By: PHP/4.0.4pl1 Content-type: text/html array(2) { [0]=> array(2) { [0]=> int(1) [1]=> string(1) "a" } [1]=> array(2) { [0]=> int(2) [1]=> string(1) "b" } } -- Edit Bug report at: http://bugs.php.net/?id=11893&edit=1

« previous php.dev (#58936) next »