PHP 4.0 Bug #7958: array_diff does not perform as stated in the description
| From: | slliid at hotmail dot com | Date: | Fri, 24 Nov 2000 08:28:13 +0000 |
| Subject: | PHP 4.0 Bug #7958: array_diff does not perform as stated in the description | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39082@lists.php.net to get a copy of this message | ||
From: slliid@hotmail.com
Operating system: Win NT 4.0
PHP version: 4.0.3pl1
PHP Bug Type: Unknown/Other Function
Bug description: array_diff does not perform as stated in the description
<?php
$array1[0] = "first";
$array1[1] = "second";
$array1[2] = "third";
$array1[3] = "fourth";
$array2[0] = "second";
$array2[1] = "fourth";
$diff = array_diff ($array1, $array2);
for ($a = 0; $diff[$a]; $a++){
print $diff[$a] . "<br>\n";
}
// This script should have printed "first" and "third" if the function was
working fine, but instead it only printed "first".
// Seems like the comparison stops once a match has been found.
// It therefore is unable to list out all the differences.
?>
--
Edit Bug report at: http://bugs.php.net/?id=7958&edit=1