From:             linuxfool at hotmail dot com
Operating system: RH9
PHP version:      Irrelevant
PHP Bug Type:     PHP options/info functions
Bug description:  array_diff issue

Description:
------------
See Code.

Thanks for your time.

Reproduce code:
---------------
echo "<pre>";
echo "RUNNING PHP VER 4.2.2 ON RH 9\n";

$array1 = array
(1=>9,2=>10,3=>5,4=>54,5=>30,6=>1,7=>22,8=>22,9=>111,10=>110,11=>30);
$array2 = array
(1=>9,2=>10,3=>5,4=>54,5=>30,6=>1,7=>22,8=>22,9=>111,10=>110,11=>112);
print_r($array1);
print_r($array2);

print_r(array_diff($array1,$array2));

echo "If the last value in array1 (30) is changed to anything other then
30(that i am aware of) array_diff  works right.\nHave I been smoking too
much crack again?\n";


echo "</pre>";
?>


Expected result:
----------------
RUNNING PHP VER 4.2.2 ON RH 9
Array
(
    [1] => 9
    [2] => 10
    [3] => 5
    [4] => 54
    [5] => 30
    [6] => 1
    [7] => 22
    [8] => 22
    [9] => 111
    [10] => 110
    [11] => 30
)
Array
(
    [1] => 9
    [2] => 10
    [3] => 5
    [4] => 54
    [5] => 30
    [6] => 1
    [7] => 22
    [8] => 22
    [9] => 111
    [10] => 110
    [11] => 112
)
Array
(
[11] => 30
)
If the last value in array1 (30) is changed to anything other then 30(that
i am aware of) it works right.
Have I been smoking too much crack again?



Actual result:
--------------
RUNNING PHP VER 4.2.2 ON RH 9
Array
(
    [1] => 9
    [2] => 10
    [3] => 5
    [4] => 54
    [5] => 30
    [6] => 1
    [7] => 22
    [8] => 22
    [9] => 111
    [10] => 110
    [11] => 30
)
Array
(
    [1] => 9
    [2] => 10
    [3] => 5
    [4] => 54
    [5] => 30
    [6] => 1
    [7] => 22
    [8] => 22
    [9] => 111
    [10] => 110
    [11] => 112
)
Array
(
)
If the last value in array1 (30) is changed to anything other then 30(that
i am aware of) it works right.
Have I been smoking too much crack again?



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

Reply via email to