mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

While reviewing the existing tests in the `constexpr` directory, I found that some of the names were not updated to reflect the contents when the contents were changed in #9301. Follow-up to #15638
16 lines
360 B
PHP
16 lines
360 B
PHP
--TEST--
|
|
Self-referencing constant expression (part of a constant AST)
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
const FOO = [self::BAR];
|
|
const BAR = [self::FOO];
|
|
}
|
|
var_dump(A::FOO);
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Cannot declare self-referencing constant self::BAR in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): [constant expression]()
|
|
#1 {main}
|
|
thrown in %s on line %d
|