File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed 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 with nullsafe operator
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 with nullsafe operator
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 @@ -10631,6 +10631,7 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
10631
10631
zend_eval_const_expr (& ast -> child [2 ]);
10632
10632
return ;
10633
10633
case ZEND_AST_PROP :
10634
+ case ZEND_AST_NULLSAFE_PROP :
10634
10635
zend_eval_const_expr (& ast -> child [0 ]);
10635
10636
zend_eval_const_expr (& ast -> child [1 ]);
10636
10637
return ;
You can’t perform that action at this time.
0 commit comments