php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66646 $array[BIG_DIGITS_STRING]
Submitted: 2014-02-05 08:01 UTC Modified: 2014-02-05 12:56 UTC
From: wmtrader at yandex dot ru Assigned:
Status: Closed Package: Arrays related
PHP Version: 5.3.0-5.3.3 OS: centos 6.5
Private report: No CVE-ID: None
 [2014-02-05 08:01 UTC] wmtrader at yandex dot ru
Description:
------------
Error converting data type.

Test script:
---------------
<?php
 $m = range(85,110);
 foreach($m as $val){
   $key = $val."00000000000000000";
   $a[$key] = $key;
 }
 print_r($a);

 $b["9900000000000000000"]="1";
 print_r($b);
?>

Expected result:
----------------
Array
(
    [8500000000000000000] => 8500000000000000000
    [8600000000000000000] => 8600000000000000000
    [8700000000000000000] => 8700000000000000000
    [8800000000000000000] => 8800000000000000000
    [8900000000000000000] => 8900000000000000000
    [9000000000000000000] => 9000000000000000000
    [9100000000000000000] => 9100000000000000000
    [9200000000000000000] => 9200000000000000000
    [9300000000000000000] => 9300000000000000000
    [9400000000000000000] => 9400000000000000000
    [9500000000000000000] => 9500000000000000000
    [9600000000000000000] => 9600000000000000000
    [9700000000000000000] => 9700000000000000000
    [9800000000000000000] => 9800000000000000000
    [9900000000000000000] => 9900000000000000000
    [10000000000000000000] => 10000000000000000000
    [10100000000000000000] => 10100000000000000000
    [10200000000000000000] => 10200000000000000000
    [10300000000000000000] => 10300000000000000000
    [10400000000000000000] => 10400000000000000000
    [10500000000000000000] => 10500000000000000000
    [10600000000000000000] => 10600000000000000000
    [10700000000000000000] => 10700000000000000000
    [10800000000000000000] => 10800000000000000000
    [10900000000000000000] => 10900000000000000000
    [11000000000000000000] => 11000000000000000000
)
Array
(
    [9900000000000000000] => 1
)

Actual result:
--------------
Array
(
    [8500000000000000000] => 8500000000000000000
    [8600000000000000000] => 8600000000000000000
    [8700000000000000000] => 8700000000000000000
    [8800000000000000000] => 8800000000000000000
    [8900000000000000000] => 8900000000000000000
    [9000000000000000000] => 9000000000000000000
    [9100000000000000000] => 9100000000000000000
    [9200000000000000000] => 9200000000000000000
    [-9146744073709551616] => 9300000000000000000
    [-9046744073709551616] => 9400000000000000000
    [-8946744073709551616] => 9500000000000000000
    [-8846744073709551616] => 9600000000000000000
    [-8746744073709551616] => 9700000000000000000
    [-8646744073709551616] => 9800000000000000000
    [-8546744073709551616] => 9900000000000000000
    [10000000000000000000] => 10000000000000000000
    [10100000000000000000] => 10100000000000000000
    [10200000000000000000] => 10200000000000000000
    [10300000000000000000] => 10300000000000000000
    [10400000000000000000] => 10400000000000000000
    [10500000000000000000] => 10500000000000000000
    [10600000000000000000] => 10600000000000000000
    [10700000000000000000] => 10700000000000000000
    [10800000000000000000] => 10800000000000000000
    [10900000000000000000] => 10900000000000000000
    [11000000000000000000] => 11000000000000000000
)
Array
(
    [-8546744073709551616] => 1
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-05 12:38 UTC] vovan-ve at yandex dot ru
Test code works fine in PHP/5.3.10 x64.
Sandbox http://sandbox.onlinephpfunctions.com/ sais, that is also works fine in 5.4.21 and 5.5.5
 [2014-02-05 12:49 UTC] wmtrader at yandex dot ru
-PHP Version: 5.4.24 +PHP Version: 5.3.0-5.3.3
 [2014-02-05 12:49 UTC] wmtrader at yandex dot ru
Problem is actual only for versions 5.3.0-5.3.3
 [2014-02-05 12:56 UTC] wmtrader at yandex dot ru
-Status: Open +Status: Closed
 [2014-02-05 12:56 UTC] wmtrader at yandex dot ru
Close this topic.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 14:01:32 2024 UTC