1--TEST-- 2GH-16041 001: 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 14continue 15quit 16--FILE-- 17<?php 18 19class Canary { 20 public function __destruct() { 21 new Canary(); 22 } 23} 24 25new Canary(); 26 27?> 28--EXPECTF-- 29[Successful compilation of %sgh16041_001.php] 30prompt> prompt> [Uncaught Error in %s on line %d: Maximum call stack size of %d bytes%s 31>00005: new Canary(); 32 00006: } 33 00007: } 34prompt> [Uncaught Error in %s on line %d] 35Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? in %s:%d 36Stack trace: 37#0 %s(%d): Canary->__destruct() 38%a 39prompt> 40