#25129 [Opn->Bgs]: Array_diff gives a bad result

From: Date: Mon, 18 Aug 2003 14:48:23 +0000
Subject: #25129 [Opn->Bgs]: Array_diff gives a bad result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-46106@lists.php.net to get a copy of this message
ID: 25129 Updated by: derick@php.net Reported By: tech at mediaforest dot net -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux PHP Version: Irrelevant New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php From the manual: array_diff() returns an array containing all the values of array1 that are not present in any of the other arguments. Previous Comments: ------------------------------------------------------------------------ [2003-08-18 09:42:10] tech at mediaforest dot net 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 this bug report at http://bugs.php.net/?id=25129&edit=1

« previous php.bugs (#46106) next »