File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-10356: Incorrect line number of constant in constant expression
3+ --FILE--
4+ <?php
5+
6+ final class Foo {
7+ public static $ foo = [
8+ 'foo ' => DOES_NOT_EXIST ,
9+ ];
10+ }
11+
12+ new Foo ();
13+
14+ ?>
15+ --EXPECTF--
16+ Fatal error: Uncaught Error: Undefined constant "DOES_NOT_EXIST" in %s:5
17+ Stack trace:
18+ #0 %s(%d): [constant expression]()
19+ #1 {main}
20+ thrown in %s on line 5
Original file line number Diff line number Diff line change @@ -10005,6 +10005,7 @@ static void zend_compile_const_expr_const(zend_ast **ast_ptr) /* {{{ */
1000510005 return ;
1000610006 }
1000710007
10008+ CG (zend_lineno ) = zend_ast_get_lineno (ast );
1000810009 zend_ast_destroy (ast );
1000910010 * ast_ptr = zend_ast_create_constant (resolved_name ,
1001010011 !is_fully_qualified && FC (current_namespace ) ? IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE : 0 );
You can’t perform that action at this time.
0 commit comments