test_json_encode_decode fails in PHP 5.4
|Reported by:||georgestephanis||Owned by:|
test_json_encode_decode fails in PHP 5.4 because the PEAR JSON compat class doesn't declare isError as a static function on line 864.
This really won't ever cause any actual problems because it's only there for compat with PHP 5.2, and static doesn't kick problems until 5.4 -- so it's just when running Unit Tests that the class is included and explicitly run that it can whine.
Patch attempts to fix this, by just testing for both the functions json_encode and json_decode existing, and that they work properly.
On 5.2, they will include the class automatically, and test cleanly. On 5.4, it'll just test the native functions. This feels better to me than testing a class that won't ever be included, or modifying an imported class to add a static keyword.