test-45989.phpt Revision df595a9fb894 (Tue Dec 16 2008 at 17:17) - Diff Link to this snippet: https://friendpaste.com/1BnWr4haCmIoRsscY9fpWt Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223--TEST--json_decode() function - a test to verify that json_decode() returns NULL on an invalid json string--SKIPIF--<?php if (!function_exists('json')) echo "SKIP"; ?>--FILE--<?php/** * All values were verified to be invalid JSON on jsonlint.com. * * Therefor, json_encode() should return NULL on those values as noted in the documentation. * * @link http://bugs.php.net/bug.php?id=45989 */var_dump(json_decode("'invalid json'"));var_dump(json_decode('invalid json'));var_dump(json_decode(' {'));var_dump(json_decode(' ['));?>--EXPECT--NULLNULLNULLNULL