|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-20 08:13 UTC] arjen at react dot com
[2014-06-20 12:55 UTC] martin at ringehahn dot de
[2017-03-31 17:35 UTC] bukka@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: bukka
[2017-03-31 17:45 UTC] bukka@php.net
[2017-04-28 19:33 UTC] bukka@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ It appears that in 5.5, "#61537 json_encode() incorrectly truncates/discards information" has been addressed. php 5.4 and 5.3 also had this patch at some point but it was reverted later. I assume this was done for not breaking backcompat in point releases. However, the php 5.5 Changelog fails to mentioned that json_encode changed behaviour and now behaves as documented. specifically: "Returns a JSON encoded string on success or FALSE on failure." the documentation also fails to mention the new constant `JSON_PARTIAL_OUTPUT_ON_ERROR`. well, it actually mentions it by referencing to it but it is not listed as a proper item. Test script: --------------- echo json_encode(["foo" => chr(132), "bar" => "bar"]); // nothing, false // this used to return "Expected result" Expected result: ---------------- since the Changelog does not mention anything json-related, I'd expect the same behaviour as in previous versions: echo json_encode(["foo" => chr(132), "bar" => "bar"]); PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in php shell code on line 1 {"foo":null,"bar":"bar"} Actual result: -------------- false