Ask a Question related to PHP Bugs, Design and Development.
-
phpreport at alecweb dot be #1
#40769 [NEW]: array_diff() doesn't compare booleans
From: phpreport at alecweb dot be
Operating system: MacOSX
PHP version: 5.2.1
PHP Bug Type: Arrays related
Bug description: array_diff() doesn't compare booleans
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 bug report at http://bugs.php.net/?id=40769&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40769&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40769&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40769&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40769&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40769&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40769&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40769&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40769&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40769&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40769&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40769&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40769&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40769&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40769&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40769&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40769&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40769&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40769&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40769&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40769&r=mysqlcfg
phpreport at alecweb dot be Guest
-
#39811 [NEW]: array_diff "compare with 2" bug
From: wishm at bk dot ru Operating system: win32 PHP version: 4.4.4 PHP Bug Type: Arrays related Bug description: ... -
#25164 [Com]: array_diff issue
ID: 25164 Comment by: linuxfool at Hotmail dot com Reported By: linuxfool at hotmail dot com Status: Bogus Bug... -
#25164 [Opn->Bgs]: array_diff issue
ID: 25164 Updated by: derick@php.net Reported By: linuxfool at hotmail dot com -Status: Open +Status: ... -
#25129 [Opn->Bgs]: Array_diff gives a bad result
ID: 25129 Updated by: derick@php.net Reported By: tech at mediaforest dot net -Status: Open +Status: ... -
Booleans
Okay, as a convert from Perl to Ruby, I have to say that I love just about everything Ruby has to offer. Just about. I wish it had better... -
tony2001@php.net #2
#40769 [Opn->Bgs]: array_diff() doesn't compare booleans
ID: 40769
Updated by: [email]tony2001@php.net[/email]
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:
[url]http://php.net/array_diff[/url]
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
tony2001@php.net Guest



Reply With Quote

