#40769 [Opn->Bgs]: array_diff() doesn't compare booleans
| From: | tony2001@php.net | Date: | Fri, 09 Mar 2007 23:55:43 +0000 |
| Subject: | #40769 [Opn->Bgs]: array_diff() doesn't compare booleans | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110168@lists.php.net to get a copy of this message | ||
ID: 40769
Updated by: tony2001@php.net
Reported By: phpreport at alecweb dot be
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: MacOSX
PHP Version: 5.2.1
New Comment:
http://php.net/array_diff
array_diff() - returns an array containing all the values of array1
that are not present in any of the other arguments.
Previous Comments:
------------------------------------------------------------------------
[2007-03-09 20:34:44] phpreport at alecweb dot be
Description:
------------
array_diff doesn't compare booleans.
Reproduce code:
---------------
$array1 = Array
(
[domains] => 300
[subdomains] => 120
[cgi] =>
[php] =>
[safemode] => 1
)
$array2 = Array
(
[domains] => 300
[subdomains] => 120
[cgi] => 1
[php] => 1
[safemode] =>
)
$arrayres = array_diff($array1, $array2);
Expected result:
----------------
this is a vardump of $array1, $array2 and $arrayres
array(5) {
["domains"]=>
string(3) "300"
["subdomains"]=>
string(3) "120"
["cgi"]=>
bool(false)
["php"]=>
bool(false)
["safemode"]=>
bool(true)
}
array(5) {
["domains"]=>
string(3) "300"
["subdomains"]=>
string(3) "120"
["cgi"]=>
bool(true)
["php"]=>
bool(true)
["safemode"]=>
bool(false)
}
array(0) {
["cgi"]=>
bool(false)
["php"]=>
bool(false)
["safemode"]=>
bool(true)
}
Actual result:
--------------
this is a vardump of $array1, $array2 and $arrayres
array(5) {
["domains"]=>
string(3) "300"
["subdomains"]=>
string(3) "120"
["cgi"]=>
bool(false)
["php"]=>
bool(false)
["safemode"]=>
bool(true)
}
array(5) {
["domains"]=>
string(3) "300"
["subdomains"]=>
string(3) "120"
["cgi"]=>
bool(true)
["php"]=>
bool(true)
["safemode"]=>
bool(false)
}
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40769&edit=1