summaryrefslogtreecommitdiff
path: root/ext/json/tests/004.phpt
blob: 1d282f9a961151e3457a09c2a306c208f18719db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
json_encode() & endless loop - 2
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php

$a = new stdclass;
$a->prop = $a;

var_dump($a);
var_dump(json_encode($a));

echo "Done\n";
?>
--EXPECTF--	
object(stdClass)#%d (1) {
  ["prop"]=>
  *RECURSION*
}

Warning: json_encode(): recursion detected in %s on line %d
string(22) "{"prop":{"prop":null}}"
Done