Result on PHP 5.6
json_decode('', true); echo last_json_error(); // 0
Result on PHP 7.0
json_decode('', true); echo last_json_error(); // 4
I checked the changelog of PHP 7 (https://github.com/tpunt/PHP7-Reference) and could not find the reason for that. JSON got replaced by JSOND but the BC breaks list does not mention that!?
My question is not about valid/invalid JSON. It’s about the behavior change of PHP I could not find.
It was marked as a bug and was fixed: https://bugs.php.net/bug.php?id=68938
You can find change logs here: http://php.net/ChangeLog-7.php#7.0.0 (search for json_decode)