1--TEST--
2GH-16041 002: Stack overflow in phpdbg
3--SKIPIF--
4<?php
5if (ini_get('zend.max_allowed_stack_size') === false) {
6    die('skip No stack limit support');
7}
8?>
9--INI--
10zend.max_allowed_stack_size=512K
11--PHPDBG--
12set pagination off
13run
14quit
15--FILE--
16<?php
17
18function map() {
19    array_map('map', [1]);
20}
21
22try {
23    map();
24} catch (\Throwable $e) {
25    printf("%s: %s\n", $e::class, $e->getMessage());
26}
27
28?>
29--EXPECTF--
30[Successful compilation of %sgh16041_002.php]
31prompt> prompt> Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
32[Script ended normally]
33prompt>
34