PHP 4.0 Bug #7958 Updated: array_diff does not perform as stated in the description
| From: | slliid at hotmail dot com | Date: | Fri, 24 Nov 2000 09:46:03 +0000 |
| Subject: | PHP 4.0 Bug #7958 Updated: array_diff does not perform as stated in the description | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-39087@lists.php.net to get a copy of this message | ||
ID: 7958
User Update by: slliid@hotmail.com
Old-Status: Open
Status: Closed
Bug Type: Unknown/Other Function
Description: array_diff does not perform as stated in the description
Previous Comments:
---------------------------------------------------------------------------
[2000-11-24 03:28:13] slliid@hotmail.com
<?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.
?>
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7958