Bug #63737 [Opn->Ana]: json_decode does not properly decode with options parameter

From: Date: Tue, 11 Dec 2012 11:04:55 +0000
Subject: Bug #63737 [Opn->Ana]: json_decode does not properly decode with options parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-175269@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63737&edit=1

 ID:                 63737
 Updated by:         aharvey@php.net
 Reported by:        googleguy@php.net
 Summary:            json_decode does not properly decode with options
                     parameter
-Status:             Open
+Status:             Analyzed
 Type:               Bug
 Package:            JSON related
 PHP Version:        5.4.9
-Assigned To:        
+Assigned To:        aharvey
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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)

« previous php.bugs (#175269) next »