xref: /PHP-8.1/Zend/tests/gh10709_2.phpt (revision 7202fe16)
1--TEST--
2GH-10709: Recursive class constant evaluation
3--FILE--
4<?php
5
6class B {
7    public $prop = A::C;
8}
9
10spl_autoload_register(function ($class) {
11    class A { const C = "A"; }
12    var_dump(new B());
13});
14
15try {
16    var_dump(new B());
17} catch (Error $e) {
18    echo $e->getMessage(), "\n";
19}
20
21?>
22--EXPECT--
23object(B)#2 (1) {
24  ["prop"]=>
25  string(1) "A"
26}
27object(B)#2 (1) {
28  ["prop"]=>
29  string(1) "A"
30}
31