File tree 2 files changed +21
-0
lines changed
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) /* {{{ */
10005
10005
return ;
10006
10006
}
10007
10007
10008
+ CG (zend_lineno ) = zend_ast_get_lineno (ast );
10008
10009
zend_ast_destroy (ast );
10009
10010
* ast_ptr = zend_ast_create_constant (resolved_name ,
10010
10011
!is_fully_qualified && FC (current_namespace ) ? IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE : 0 );
You can’t perform that action at this time.
0 commit comments