diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:36:21 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:36:21 -0400 |
| commit | d29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (patch) | |
| tree | b38e2e5c6974b9a15f103e5cf884cba9fff90ef4 /ext/json/tests/004.phpt | |
| parent | a88a88d0986a4a32288c102cdbfebd78d7e91d99 (diff) | |
| download | php-upstream/5.2.0.tar.gz | |
Imported Upstream version 5.2.0upstream/5.2.0
Diffstat (limited to 'ext/json/tests/004.phpt')
| -rw-r--r-- | ext/json/tests/004.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/json/tests/004.phpt b/ext/json/tests/004.phpt new file mode 100644 index 000000000..884d87420 --- /dev/null +++ b/ext/json/tests/004.phpt @@ -0,0 +1,27 @@ +--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"]=> + object(stdClass)#%d (1) { + ["prop"]=> + *RECURSION* + } +} + +Warning: json_encode(): recursion detected in %s on line %d +string(22) "{"prop":{"prop":null}}" +Done |
