php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8653 function array_diff fails for larger arrays
Submitted: 2001-01-11 08:56 UTC Modified: 2001-01-12 12:59 UTC
From: kennie dot nybo dot mortensen at vigilante dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.0.4 OS: winnt4 build 1381
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kennie dot nybo dot mortensen at vigilante dot com
New email:
PHP Version: OS:

 

 [2001-01-11 08:56 UTC] kennie dot nybo dot mortensen at vigilante dot com
<?
# run this!

$array1 = array(
    0 => 8221874,
    31 => -237983854,
    32 => -178422741,
    33 => -133452210,
    34 => -132423065,
    35 => -86484311,
);

$array2 = array(
    3 => -237983854,
    4 => -178422741,
    6 => -133452210,
    7 => -132423065,
    8 => -86484311,
    11 => 8221874,
);

$array3 = array(
    0 => 8221874,
    1 => 41196856,
    2 => 72211234,
    3 => 176494324,
    4 => 208997856,
    5 => 228939765,
    6 => 330073804,
    7 => 340600386,
    8 => 618210552,
    9 => 762247645,
    10 => 900146471,
    11 => 1091304725,
    12 => 1140421591,
    13 => 1270411028,
    14 => 1478191477,
    15 => 1673874064,
    16 => 1903882621,
    17 => 1999343365,
    18 => 2140576596,
    19 => -2118575707,
    20 => -2017197384,
    21 => -1809590647,
    22 => -1766079050,
    23 => -1637347426,
    24 => -1482531933,
    25 => -1479363897,
    26 => -1391639078,
    27 => -1246350380,
    28 => -1054044604,
    29 => -982856673,
    30 => -447800894,
    31 => -237983854,
    32 => -178422741,
    33 => -133452210,
    34 => -132423065,
    35 => -86484311,
    36 => -17918422,
    37 => -14497841
);

$array4 = array(
    0 => -447800894,
    1 => -418764538,
    2 => -392625909,
    3 => -237983854,
    4 => -178422741,
    5 => -170886411,
    6 => -133452210,
    7 => -132423065,
    8 => -86484311,
    9 => -17918422,
    10 => -14497841,
    11 => 8221874,
    12 => 41196856,
    13 => 72211234,
    14 => 176494324,
    15 => 208997856,
    16 => 228939765,
    17 => 330073804,
    18 => 340600386,
    19 => 447686053,
    20 => 618210552,
    21 => 762247645,
    22 => 900146471,
    23 => 931246825,
    24 => 931347017,
    25 => 1091304725,
    26 => 1098325520,
    27 => 1140421591,
    28 => 1270411028,
    29 => 1283087206,
    30 => 1478191477,
    31 => 1545959313,
    32 => 1546768297,
    33 => 1582484674,
    34 => 1609828347,
    35 => 1652353999,
    36 => 1673874064,
    37 => 1903882621,
    38 => 1999343365,
    39 => 2140576596,
    40 => -2118575707,
    41 => -2092056065,
    42 => -2041328486,
    43 => -2017197384,
    44 => -1815706420,
    45 => -1809590647,
    46 => -1766079050,
    47 => -1682601875,
    48 => -1637347426,
    49 => -1482531933,
    50 => -1479363897,
    51 => -1477072276,
    52 => -1431626038,
    53 => -1391639078,
    54 => -1246350380,
    55 => -1054044604,
    56 => -982856673,
    57 => -904181010
);

echo "array_diff on small arrays:\n";
print_r(array_diff ($array1,$array2));

echo "array_diff on bigger arrays:\n";
print_r(array_diff ($array3,$array4));
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-12 12:59 UTC] cynic@php.net
seems to be fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC