File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ PHP NEWS
22|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33?? ??? ????, PHP 8.5.0RC3
44
5+ - Core:
6+ . Fixed bug GH-20113 (Missing new Foo(...) error in constant expressions).
7+ (ilutov)
8+
59- FPM:
610 . Fixed bug GH-19817 (Decode SCRIPT_FILENAME issue in php 8.5).
711 (Jakub Zelenka)
812
9-
1013- SPL:
1114 . Fixed bug GH-20101 (SplHeap/SplPriorityQueue serialization
1215 exposes INDIRECTs). (nielsdos)
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-20113: new Foo(...) error in constant expressions
3+ --FILE--
4+ <?php
5+ const C = new \stdClass (...);
6+ ?>
7+ --EXPECTF--
8+ Fatal error: Cannot create Closure for new expression in %s on line %d
Original file line number Diff line number Diff line change @@ -11468,6 +11468,11 @@ static void zend_compile_const_expr_new(zend_ast **ast_ptr)
1146811468{
1146911469 zend_ast * class_ast = (* ast_ptr )-> child [0 ];
1147011470 zend_compile_const_expr_class_reference (class_ast );
11471+
11472+ zend_ast * args_ast = (* ast_ptr )-> child [1 ];
11473+ if (args_ast -> kind == ZEND_AST_CALLABLE_CONVERT ) {
11474+ zend_error_noreturn (E_COMPILE_ERROR , "Cannot create Closure for new expression" );
11475+ }
1147111476}
1147211477
1147311478static void zend_compile_const_expr_closure (zend_ast * * ast_ptr )
You can’t perform that action at this time.
0 commit comments