File tree Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ PHP NEWS
28
28
- MySQLnd:
29
29
. Fixed bug GH-8058 (NULL pointer dereference in mysqlnd package). (Kamil Tekiela)
30
30
31
+ - Reflection:
32
+ . Fixed bug GH-8080 (ReflectionClass::getConstants() depends on def. order).
33
+ (cmb)
34
+
31
35
- Zlib:
32
36
. Fixed bug GH-7953 (ob_clean() only does not set Content-Encoding). (cmb)
33
37
Original file line number Diff line number Diff line change @@ -4637,7 +4637,7 @@ ZEND_METHOD(ReflectionClass, getConstants)
4637
4637
4638
4638
array_init (return_value );
4639
4639
ZEND_HASH_FOREACH_STR_KEY_PTR (CE_CONSTANTS_TABLE (ce ), key , constant ) {
4640
- if (UNEXPECTED (zval_update_constant_ex (& constant -> value , ce ) != SUCCESS )) {
4640
+ if (UNEXPECTED (zval_update_constant_ex (& constant -> value , constant -> ce ) != SUCCESS )) {
4641
4641
RETURN_THROWS ();
4642
4642
}
4643
4643
@@ -4696,7 +4696,7 @@ ZEND_METHOD(ReflectionClass, getConstant)
4696
4696
GET_REFLECTION_OBJECT_PTR (ce );
4697
4697
constants_table = CE_CONSTANTS_TABLE (ce );
4698
4698
ZEND_HASH_FOREACH_PTR (constants_table , c ) {
4699
- if (UNEXPECTED (zval_update_constant_ex (& c -> value , ce ) != SUCCESS )) {
4699
+ if (UNEXPECTED (zval_update_constant_ex (& c -> value , c -> ce ) != SUCCESS )) {
4700
4700
RETURN_THROWS ();
4701
4701
}
4702
4702
} ZEND_HASH_FOREACH_END ();
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-8080 (ReflectionClass::getConstants() depends on def. order)
3
+ --FILE--
4
+ <?php
5
+ class A {
6
+ const LIST = [
7
+ self ::TEST => 'Test ' ,
8
+ ];
9
+ private const TEST = 'test ' ;
10
+ }
11
+
12
+ class B extends A {}
13
+
14
+ $ r = new ReflectionClass (B::class);
15
+ var_dump (
16
+ $ r ->getConstants (),
17
+ $ r ->getConstant ("LIST " )
18
+ );
19
+ ?>
20
+ --EXPECT--
21
+ array(1) {
22
+ ["LIST"]=>
23
+ array(1) {
24
+ ["test"]=>
25
+ string(4) "Test"
26
+ }
27
+ }
28
+ array(1) {
29
+ ["test"]=>
30
+ string(4) "Test"
31
+ }
You can’t perform that action at this time.
0 commit comments