You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
560 B

--TEST--
json_last_error() tests
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_decode("[1]"));
var_dump(json_last_error());
var_dump(json_decode("[[1]]", false, 2));
var_dump(json_last_error());
var_dump(json_decode("[1}"));
var_dump(json_last_error());
var_dump(json_decode('["' . chr(0) . 'abcd"]'));
var_dump(json_last_error());
var_dump(json_decode("[1"));
var_dump(json_last_error());
echo "Done\n";
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}
int(0)
NULL
int(1)
NULL
int(2)
NULL
int(3)
NULL
int(4)
Done