[php-src] Issue #10356: Misleading error reporting when using a non-existent constant in a static variable initializer

From: Date: Tue, 17 Jan 2023 09:58:58 +0000
Subject: [php-src] Issue #10356: Misleading error reporting when using a non-existent constant in a static variable initializer
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-243474@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10356 Author: TimWolla ### Description The following code (https://3v4l.org/la8tX): ```php <?php final class Foo { public static $foo = [ 'foo' => DOES_NOT_EXIST, ]; } new Foo(); ``` Resulted in this output: ``` Fatal error: Uncaught Error: Undefined constant "DOES_NOT_EXIST" in /in/la8tX:9 Stack trace: #0 {main} thrown in /in/la8tX on line 9 ``` But I expected this output instead: Some indication that the broken constant is in line 5, because line 9 clearly does not contain any constants. ### PHP Version PHP 8.2.1 ### Operating System _No response_

« previous php.bugs (#243474) next »