php-src
php-src copied to clipboard
New in initializers self reference causes SIGSEGV error
Description
The following code:
<?php
class A
{
function __construct($a = new A())
{
}
}
new A();
Resulted in this output:
(none) with exit code 139 - SIGSEGV (Address boundary error)
But I expected this output instead:
infinite loop/recursion error/stack depth error/whatever more descriptive
PHP Version
PHP 8.1.4
Operating System
Ubuntu 20.04
This is an instance of a magic call recursion stack overflow, which is already tracked at https://bugs.php.net/bug.php?id=64196.