xref: /PHP-8.0/ext/reflection/tests/bug53915.phpt (revision 7aacc705)
1--TEST--
2Bug #53915 - ReflectionClass::getConstant(s) emits fatal error on selfreferencing constants
3--FILE--
4<?php
5Class Foo
6{
7    const A = 1;
8    const B = self::A;
9}
10
11$rc = new ReflectionClass('Foo');
12print_r($rc->getConstants());
13
14Class Foo2
15{
16        const A = 1;
17        const B = self::A;
18}
19
20$rc = new ReflectionClass('Foo2');
21print_r($rc->getConstant('B'));
22?>
23--EXPECT--
24Array
25(
26    [A] => 1
27    [B] => 1
28)
291
30