From: [EMAIL PROTECTED]
Operating system: Linux RedHat
PHP version: 4.2.2
PHP Bug Type: Arrays related
Bug description: array_diff error with array contain NULL values.
This work !!!
------------------------------------------------
$arr1 = array('Color' => '');
$arr2 = array('Img1' => 3, 'Img2' => 2, 'Color' => 'Yellow');
print_r(array_diff($arr1, $arr2));
Return : Array ( [Color] => )
This not work!!!
------------------------------------------------
$arr1 = array('Color' => '');
$arr2 = array('Img1' => NULL, 'Img2' => 2, 'Color' => 'Yellow');
print_r(array_diff($arr1, $arr2));
Return : Array ()
This work !!!
------------------------------------------------
$arr1 = array('Color' => 'Red');
$arr2 = array('Img1' => NULL, 'Img2' => 2, 'Color' => 'Yellow');
print_r(array_diff($arr1, $arr2));
When your array contain NULL value the array diff does not recognize that
Color is different. But if "Color" is not empty and different in both
array the return value is corect.
Sorry for my english !
Yanik
--
Edit bug report at http://bugs.php.net/?id=20319&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20319&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20319&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20319&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20319&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20319&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20319&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20319&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20319&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20319&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20319&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20319&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20319&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20319&r=isapi