xref: /PHP-5.3/ext/json/tests/004.phpt (revision 250393f9)
1--TEST--
2json_encode() & endless loop - 2
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7
8$a = new stdclass;
9$a->prop = $a;
10
11var_dump($a);
12var_dump(json_encode($a));
13
14echo "Done\n";
15?>
16--EXPECTF--
17object(stdClass)#%d (1) {
18  ["prop"]=>
19  *RECURSION*
20}
21
22Warning: json_encode(): recursion detected in %s on line %d
23string(22) "{"prop":{"prop":null}}"
24Done
25