ID:               46730
 User updated by:  info at marcel-schlesinger dot de
 Reported By:      info at marcel-schlesinger dot de
 Status:           Open
-Bug Type:         Unknown/Other Function
+Bug Type:         JSON related
 Operating System: ALL
 PHP Version:      5.2.6
 New Comment:

Updated category


Previous Comments:
------------------------------------------------------------------------

[2008-12-02 12:53:32] info at marcel-schlesinger dot de

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 this bug report at http://bugs.php.net/?id=46730&edit=1

Reply via email to