1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/json/tests/bug62369.phpt
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00

34 lines
575 B
PHP

--TEST--
FR #62369 (Segfault on json_encode(deeply_nested_array)
--FILE--
<?php
$array = array();
for ($i=0; $i < 550; $i++) {
$array = array($array);
}
json_encode($array, 0, 551);
switch (json_last_error()) {
case JSON_ERROR_NONE:
echo 'OK' . PHP_EOL;
break;
case JSON_ERROR_DEPTH:
echo 'ERROR' . PHP_EOL;
break;
}
json_encode($array, 0, 540);
switch (json_last_error()) {
case JSON_ERROR_NONE:
echo 'OK' . PHP_EOL;
break;
case JSON_ERROR_DEPTH:
echo 'ERROR' . PHP_EOL;
break;
}
?>
--EXPECT--
OK
ERROR