From:             tech at mediaforest dot net
Operating system: Linux
PHP version:      Irrelevant
PHP Bug Type:     Arrays related
Bug description:  Array_diff gives a bad result

Description:
------------
As this script shows, the array_diff function doesn't give the expected
result on a php4.2.3 :



Reproduce code:
---------------
<?
$today_list = array("pic_0710.jpg","pic_0740.jpg");
$yesterday_list = array("pic_0710.jpg","pic_0740.jpg","pic_0910.jpg");
$result = array_diff($today_list,$yesterday_list);

var_dump($result);

?>

Expected result:
----------------
array(1) { [0]=>  string(12) "pic_0910.jpg" }

Actual result:
--------------
array(0) { }

-- 
Edit bug report at http://bugs.php.net/?id=25129&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25129&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25129&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25129&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25129&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25129&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25129&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25129&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25129&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25129&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25129&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25129&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25129&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25129&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25129&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25129&r=gnused

Reply via email to