ZF-8918: missing thrown exception on decode invalid json


Zend_Json::decode doesn't throw an exception on failure.

Additionally the return value of json_decode has changed on invalid data within ZF supported php versions:

var_dump(json_decode('invalid json'));
// -> NULL

var_dump(json_decode('invalid json'));
// -> string(16) "invalid json"


Added a patch for build-in json_decode for php 5.2 & 5.3

Is there a chance that this could solve with 1.10 because in base of this bug Zend_Serializer_Adapter_JsonTest::testUnserialzeInvalid fails on php < 5.3

Patch applied (with additional unit test) to trunk and 1.10 release branch.