File: depth.phpt

package info (click to toggle)
php-json 1.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 684 kB
  • ctags: 521
  • sloc: ansic: 3,878; xml: 446; php: 120; sh: 22; makefile: 16
file content (31 lines) | stat: -rw-r--r-- 645 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
json_decode() with max recursion depth
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_decode("[[1]]", false, 3));
var_dump(json_last_error(), json_last_error_msg());
var_dump(json_decode("[[[1]]]", false, 3));
var_dump(json_last_error(), json_last_error_msg());
var_dump(json_decode("[[[[1]]]]", false, 3));
var_dump(json_last_error(), json_last_error_msg());
echo "Done\n";
?>
--EXPECT--
array(1) {
  [0]=>
  array(1) {
    [0]=>
    int(1)
  }
}
int(0)
string(8) "No error"
NULL
int(1)
string(28) "Maximum stack depth exceeded"
NULL
int(1)
string(28) "Maximum stack depth exceeded"
Done