1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00
Files
archived-php-src/ext/json/tests/004.phpt
T
Nikita Popov 250393f925 Revert JSON changes to PHP 5.3
This reverts the following commits:

974324676b
4662151ea7
84fe2cc890

This does not revert the JSON changes released in PHP 5.3.14.
2012-07-01 16:28:57 +02:00

25 lines
388 B
PHP

--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