Req #69422 [NEW]: json_encode() needs encoding specification
From: yohgaki
Operating system:
PHP version: Irrelevant
Package: JSON related
Bug Type: Feature/Change Request
Bug description:json_encode() needs encoding specification
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 bug report at https://bugs.php.net/bug.php?id=69422&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69422&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69422&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69422&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69422&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69422&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69422&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69422&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69422&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69422&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69422&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69422&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69422&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69422&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69422&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69422&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69422&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69422&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69422&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69422&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69422&r=mysqlcfg
Thread (4 messages)
- yohgaki@php.net