xref: /PHP-7.2/ext/reflection/tests/bug53915.phpt (revision fac1e871)
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--EXPECT--
23Array
24(
25    [A] => 1
26    [B] => 1
27)
281
29