php-src icon indicating copy to clipboard operation
php-src copied to clipboard

New in initializers self reference causes SIGSEGV error

Open carloscz opened this issue 4 years ago • 1 comments

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

carloscz avatar Apr 13 '22 11:04 carloscz

This is an instance of a magic call recursion stack overflow, which is already tracked at https://bugs.php.net/bug.php?id=64196.

cmb69 avatar Apr 13 '22 13:04 cmb69