Req #69422 [Opn]: json_encode() needs encoding specification

From: Date: Sun, 19 Apr 2015 22:13:05 +0000
Subject: Req #69422 [Opn]: json_encode() needs encoding specification
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192214@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69422&edit=1

 ID:                 69422
 Updated by:         yohgaki@php.net
 Reported by:        yohgaki@php.net
 Summary:            json_encode() needs encoding specification
 Status:             Open
 Type:               Feature/Change Request
 Package:            JSON related
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Related bug
https://bugs.php.net/bug.php?id=68456


Previous Comments:
------------------------------------------------------------------------
[2015-04-10 21:57:21] yohgaki@php.net

Description:
------------
Currently, json_encode() encode PHP int/float/bool as JSON numeric(int/float) and bool. Since JSON
numeric does not map to PHP int/float as JSON numeric could be any precision, large numbers need to
be stored as "string" which is converted to JSON string.

Some "string" needed to be encoded as numeric. To do that json_encode() needs some kind of
specification to encode data as programmer intended.

http://json-schema.org/examples.html

This could be used as the specification.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69422&edit=1


Thread (4 messages)

« previous php.bugs (#192214) next »