File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 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) /* {{{ */
1063110631 zend_eval_const_expr (& ast -> child [2 ]);
1063210632 return ;
1063310633 case ZEND_AST_PROP :
10634+ case ZEND_AST_NULLSAFE_PROP :
1063410635 zend_eval_const_expr (& ast -> child [0 ]);
1063510636 zend_eval_const_expr (& ast -> child [1 ]);
1063610637 return ;
You can’t perform that action at this time.
0 commit comments