xref: /PHP-7.4/ext/reflection/tests/bug29986.phpt (revision 3121b717)
1--TEST--
2Reflection Bug #29986 (Class constants won't work with predefined constants when using ReflectionClass)
3--INI--
4precision=14
5--FILE--
6<?php
7class just_constants
8{
9    const BOOLEAN_CONSTANT = true;
10    const NULL_CONSTANT = null;
11    const STRING_CONSTANT = 'This is a string';
12    const INTEGER_CONSTANT = 1000;
13    const FLOAT_CONSTANT = 3.14159265;
14}
15
16echo new ReflectionClass('just_constants');
17?>
18--EXPECTF--
19Class [ <user> class just_constants ] {
20  @@ %s %d-%d
21
22  - Constants [5] {
23    Constant [ public bool BOOLEAN_CONSTANT ] { 1 }
24    Constant [ public null NULL_CONSTANT ] {  }
25    Constant [ public string STRING_CONSTANT ] { This is a string }
26    Constant [ public int INTEGER_CONSTANT ] { 1000 }
27    Constant [ public float FLOAT_CONSTANT ] { 3.14159265 }
28  }
29
30  - Static properties [0] {
31  }
32
33  - Static methods [0] {
34  }
35
36  - Properties [0] {
37  }
38
39  - Methods [0] {
40  }
41}
42