Bug #72217 [Dup]: json_decode not working correctly.
| From: | bukka@php.net | Date: | Sun, 15 May 2016 15:20:14 +0000 |
| Subject: | Bug #72217 [Dup]: json_decode not working correctly. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201109@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72217&edit=1
ID: 72217
Updated by: bukka@php.net
Reported by: b dot bendeliani at gmail dot com
Summary: json_decode not working correctly.
Status: Duplicate
Type: Bug
Package: JSON related
Operating System: CentOS
PHP Version: 7.0.6
Block user comment: N
Private report: N
New Comment:
Should be part of 7.0.7
Previous Comments:
------------------------------------------------------------------------
[2016-05-15 15:19:31] bukka@php.net
This is duplicate (from the internal point of view) of https://bugs.php.net/bug.php?id=72069 and it has
been fixed by https://github.com/php/php-src/commit/589d0e0f187ff82f90110057f624c958f0d3ec86
.
------------------------------------------------------------------------
[2016-05-14 10:24:58] b dot bendeliani at gmail dot com
spelling correction.
------------------------------------------------------------------------
[2016-05-14 10:20:52] b dot bendeliani at gmail dot com
Description:
------------
I'm had this script in older version of php and there was not any error. When I upgraded to PHP
7.0.6 this problem occurred.
Test script:
---------------
class Json implements JsonSerializable
{
public function jsonSerialize()
{
json_decode("");
return ["test" => "test"];
}
}
$test = new Json;
header('Content-Type: application/json');
echo json_encode($test);
Expected result:
----------------
{"test":"test"}
Actual result:
--------------
""
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72217&edit=1