File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4524,18 +4524,18 @@ void zend_compile_class_const_decl(zend_ast *ast) /* {{{ */
4524
4524
zend_class_entry * ce = CG (active_class_entry );
4525
4525
uint32_t i ;
4526
4526
4527
+ if ((ce -> ce_flags & ZEND_ACC_TRAIT ) != 0 ) {
4528
+ zend_error_noreturn (E_COMPILE_ERROR , "Traits cannot have constants" );
4529
+ return ;
4530
+ }
4531
+
4527
4532
for (i = 0 ; i < list -> children ; ++ i ) {
4528
4533
zend_ast * const_ast = list -> child [i ];
4529
4534
zend_ast * name_ast = const_ast -> child [0 ];
4530
4535
zend_ast * value_ast = const_ast -> child [1 ];
4531
4536
zend_string * name = zend_ast_get_str (name_ast );
4532
4537
zval value_zv ;
4533
4538
4534
- if ((ce -> ce_flags & ZEND_ACC_TRAIT ) != 0 ) {
4535
- zend_error_noreturn (E_COMPILE_ERROR , "Traits cannot have constants" );
4536
- return ;
4537
- }
4538
-
4539
4539
zend_const_expr_to_zval (& value_zv , value_ast );
4540
4540
4541
4541
name = zend_new_interned_string_safe (name );
You can’t perform that action at this time.
0 commit comments