Bug #63737 [Com]: json_decode does not properly decode with options parameter
Edit report at https://bugs.php.net/bug.php?id=63737&edit=1
ID: 63737
Comment by: franssen dot roland at gmail dot com
Reported by: googleguy@php.net
Summary: json_decode does not properly decode with options
parameter
Status: Closed
Type: Bug
Package: JSON related
PHP Version: 5.4.9
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
This is still an issue in 5.4.10 (Linux)
Previous Comments:
------------------------------------------------------------------------
[2012-12-11 12:04:17] aharvey@php.net
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Fixed on 5.4, 5.5 and master.
------------------------------------------------------------------------
[2012-12-11 11:04:55] aharvey@php.net
Our code path for bare integer literals is different to the one we use for literals within objects
and arrays. Should be an easy fix.
------------------------------------------------------------------------
[2012-12-11 11:03:24] googleguy@php.net
Description:
------------
json_decode does not properly decode JSON strings using options parameter.
Test script:
---------------
json_decode('12345678901234567890', false, 512, JSON_BIGINT_AS_STRING); // this won't
work
However this will
json_decode('[12345678901234567890]', false, 512, JSON_BIGINT_AS_STRING);
Expected result:
----------------
string(20) "12345678901234567890"
Actual result:
--------------
float(1.2345678901235E+19)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63737&edit=1
Thread (8 messages)