From: info at marcel-schlesinger dot de
Operating system: ALL
PHP version: 5.2.6
PHP Bug Type: Unknown/Other Function
Bug description: json_decode and 32Bit Maschines
Description:
------------
Using json_decode with numbers higher then 2147483647 on a 32Bit maschine
is still wrong! E.g. 5095334700020 has to be converted into a float (a
string would be also okay), but not into an integer!
Reproduce code:
---------------
<?php
$json = '{"number":5095334700020}';
var_dump(json_decode($json));
?>
Expected result:
----------------
object(stdClass)#1 (1) {
["number"]=>
float(5095334700020)
}
it could also be:
object(stdClass)#1 (1) {
["number"]=>
string(13) "5095334700020"
}
Actual result:
--------------
object(stdClass)#1 (1) {
["number"]=>
int(2147483647)
}
--
Edit bug report at http://bugs.php.net/?id=46730&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46730&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46730&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46730&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46730&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46730&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46730&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46730&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46730&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46730&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46730&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46730&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46730&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46730&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46730&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46730&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46730&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46730&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46730&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46730&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46730&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46730&r=mysqlcfg