php-src/Zend/tests/constexpr/constant_expressions_self_referencing_array.phpt
DanielEScherzer 7b8a61a18c
Zend/tests: merge constant_expressions into constexpr, update names (#17872)
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
2025-02-21 18:37:39 +00:00

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