xref: /PHP-7.0/ext/reflection/tests/bug72846.phpt (revision 60de74eb)
1--TEST--
2Bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN)
3--FILE--
4<?php
5
6namespace Some {
7
8	abstract class A
9	{
10		const ONE = '1';
11		const TWO = '2';
12
13		const CONST_NUMBERS = [
14			self::ONE,
15			self::TWO,
16		];
17
18		const NUMBERS = [
19			'1',
20			'2',
21		];
22	}
23
24	class B extends A
25	{
26	}
27
28	$ref = new \ReflectionClass('Some\B');
29
30	var_dump($ref->getConstant('ONE'));
31	var_dump($ref->getConstant('CONST_NUMBERS'));
32	var_dump($ref->getConstant('NUMBERS'));
33}
34?>
35--EXPECT--
36string(1) "1"
37array(2) {
38  [0]=>
39  string(1) "1"
40  [1]=>
41  string(1) "2"
42}
43array(2) {
44  [0]=>
45  string(1) "1"
46  [1]=>
47  string(1) "2"
48}
49