ID:               40769
 Updated by:       [EMAIL PROTECTED]
 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

Reply via email to