Bug #81102 [NEW]: json integer is converted to string
| From: | kumar dot muthaiah at yahoo dot com | Date: | Thu, 03 Jun 2021 16:49:59 +0000 |
| Subject: | Bug #81102 [NEW]: json integer is converted to string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-234190@lists.php.net to get a copy of this message | ||
From: kumar dot muthaiah at yahoo dot com
Operating system: linux
PHP version: 7.4Git-2021-06-03 (Git)
Package: *General Issues
Bug Type: Bug
Bug description:json integer is converted to string
Description:
------------
json integer is converted to string in wordpress php 7.4 version for
json_encode() function. Causes javascript in client side to not load the
component that depends on json. I'm using Wordopress REST API.
Test script:
---------------
$p = {"id:": 1, "object": {"name": "kumar", "age":
10, "married":
false}};
json_encode($p['object']);
After conversion i get
{"name": "kumar", "age": "10", "married":
"false"}
Actual result:
--------------
{"name": "kumar", "age": 10, "married": false}
--
Edit bug report at https://bugs.php.net/bug.php?id=81102&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81102&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81102&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81102&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81102&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81102&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81102&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81102&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81102&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81102&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81102&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81102&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81102&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81102&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81102&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81102&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81102&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81102&r=mysqlcfg