Closed v-noskov closed 8 years ago
Fixed by #680
@v-noskov @weierophinney We need to decide whether we should fixed this in Zend_Json or not.
Fixing it will make it behaves the same as PHP5 but null
or empty string is indeed not a valid json and it is intended behavior on PHP7. See discussion on https://github.com/zendframework/zend-json/issues/23. Whatever the final decision we should make Zend_Json and ZF2 zend-json behaves the same.
References: https://bugs.php.net/bug.php?id=71718 http://php.net/manual/en/function.json-last-error.php#118165 http://stackoverflow.com/questions/36362856/php7-json-and-zend-decoding-failed-syntax-error
I think, that Zend_Json v.1.12.xx must preserve backward compatibility and demonstrate the same behaviour on all supported versions of php. Also, ZF2 components can have other behaviour than ZF1 components.
@v-noskov ZF1 has no official support for PHP 7.
This is a change to the underlying PHP method, not a bug in Zend\Json
.
I have the following code that works on php 5.6 but throws Zend_Json_Exception on PHP7.
Each call causes Zend_Json_Exception.
This bug caused by https://bugs.php.net/bug.php?id=71718 Code:
runs without exceptions.