summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug53915.phpt
blob: 633e82817b52c81c60675c274f94ab3afdc35e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Bug #53915 - ReflectionClass::getConstant(s) emits fatal error on selfreferencing constants
--FILE--
<?php
Class Foo
{
    const A = 1;
    const B = self::A;
}

$rc = new ReflectionClass('Foo');
print_r($rc->getConstants());

Class Foo2
{
        const A = 1;
        const B = self::A;
}

$rc = new ReflectionClass('Foo2');
print_r($rc->getConstant('B'));
?>
--EXPECT--
Array
(
    [A] => 1
    [B] => 1
)
1