Bug #81102 [Opn]: json integer is converted to string
| From: | cmb@php.net | Date: | Thu, 03 Jun 2021 17:18:52 +0000 |
| Subject: | Bug #81102 [Opn]: json integer is converted to string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234192@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81102&edit=1
ID: 81102
Updated by: cmb@php.net
Reported by: kumar dot muthaiah at yahoo dot com
Summary: json integer is converted to string
Status: Open
Type: Bug
Package: *General Issues
Operating System: linux
PHP Version: 7.4Git-2021-06-03 (Git)
Block user comment: N
Private report: N
New Comment:
> After conversion i get
I get a syntax error even before conversion.
Previous Comments:
------------------------------------------------------------------------
[2021-06-03 16:49:59] kumar dot muthaiah at yahoo dot com
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 this bug report at https://bugs.php.net/bug.php?id=81102&edit=1