[PHP-DEV] PHP 4.0 Bug #6002: array_diff / array_intersect returning wrong elements From: hpdl <email protected>
Date: 08/07/00

From: hpdl <email protected>
Operating system: FreeBSD 4.0
PHP version: 4.0.1pl2
PHP Bug Type: Misbehaving function
Bug description: array_diff / array_intersect returning wrong elements

array_diff was introduced in 4.0.1, but i cant get it to return the elements right.

$array1 = array ("page1", "page2", "page3", "page4");
$array2 = array ("page1", "page4");
$result = array_diff ($array1, $array2);

for ($i=0; $i < sizeof($result); $i++) {
  echo $i . '-' . $result[$i] . '<br>' . "\n";
}

i am looking for a result of array('page2','page3') - but gives me array('','page2')

array_intersect returns array('page1') with the above example.. is it not meant to return array('page1','page4') ?

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>