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 @@ -4535,18 +4535,18 @@ void zend_compile_class_const_decl(zend_ast *ast) /* {{{ */
4535
4535
zend_class_entry * ce = CG (active_class_entry );
4536
4536
uint32_t i ;
4537
4537
4538
+ if ((ce -> ce_flags & ZEND_ACC_TRAIT ) != 0 ) {
4539
+ zend_error_noreturn (E_COMPILE_ERROR , "Traits cannot have constants" );
4540
+ return ;
4541
+ }
4542
+
4538
4543
for (i = 0 ; i < list -> children ; ++ i ) {
4539
4544
zend_ast * const_ast = list -> child [i ];
4540
4545
zend_ast * name_ast = const_ast -> child [0 ];
4541
4546
zend_ast * value_ast = const_ast -> child [1 ];
4542
4547
zend_string * name = zend_ast_get_str (name_ast );
4543
4548
zval value_zv ;
4544
4549
4545
- if ((ce -> ce_flags & ZEND_ACC_TRAIT ) != 0 ) {
4546
- zend_error_noreturn (E_COMPILE_ERROR , "Traits cannot have constants" );
4547
- return ;
4548
- }
4549
-
4550
4550
zend_const_expr_to_zval (& value_zv , value_ast );
4551
4551
4552
4552
name = zend_new_interned_string_safe (name );
You can’t perform that action at this time.
0 commit comments