File tree 4 files changed +27
-0
lines changed
4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ PHP NEWS
62
62
(Tobias Bachert)
63
63
. Added error_log_mode ini setting. (Mikhail Galanin)
64
64
. Updated request startup messages. (Eric Norris)
65
+ . Fixed GH-9136 and GH-9138 (Fixed fetching property of magic constant in
66
+ constant expressions). (ilutov)
65
67
66
68
- COM:
67
69
. Fixed bug GH-8750 (Can not create VT_ERROR variant type). (cmb)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-9136: Assertion when fetching property of magic constant in constant expression
3
+ --FILE--
4
+ <?php
5
+
6
+ const C = __file__->foo ;
7
+
8
+ ?>
9
+ --EXPECTF--
10
+ Warning: Attempt to read property "foo" on string in %s on line %d
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-9138: NULL pointer dereference when fetching property of "bad" list in constant expression
3
+ --FILE--
4
+ <?php
5
+
6
+ #[Attribute([,]->e )]
7
+ class Foo {}
8
+
9
+ ?>
10
+ --EXPECTF--
11
+ Fatal error: Cannot use empty array elements in arrays in %s on line %d
Original file line number Diff line number Diff line change @@ -10616,6 +10616,10 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
10616
10616
case ZEND_AST_CONST_ENUM_INIT :
10617
10617
zend_eval_const_expr (& ast -> child [2 ]);
10618
10618
return ;
10619
+ case ZEND_AST_PROP :
10620
+ zend_eval_const_expr (& ast -> child [0 ]);
10621
+ zend_eval_const_expr (& ast -> child [1 ]);
10622
+ return ;
10619
10623
default :
10620
10624
return ;
10621
10625
}
You can’t perform that action at this time.
0 commit comments