@@ -5496,11 +5496,11 @@ void zend_compile_closure_uses(zend_ast *ast) /* {{{ */
5496
5496
}
5497
5497
/* }}} */
5498
5498
5499
- static void zend_check_magic_method_attr (uint32_t attr , const char * method ) /* {{{ */
5499
+ static void zend_check_magic_method_attr (uint32_t attr , const char * method , zend_bool is_static ) /* {{{ */
5500
5500
{
5501
- if (memcmp ( method , "__callStatic" , sizeof ( "__callStatic" ) - 1 ) == 0 ) {
5501
+ if (is_static ) {
5502
5502
if (!(attr & ZEND_ACC_PUBLIC ) || !(attr & ZEND_ACC_STATIC )) {
5503
- zend_error (E_WARNING , "The magic method __callStatic () must have public visibility and be static" );
5503
+ zend_error (E_WARNING , "The magic method %s () must have public visibility and be static" );
5504
5504
}
5505
5505
} else if (!(attr & ZEND_ACC_PUBLIC ) || (attr & ZEND_ACC_STATIC )) {
5506
5506
zend_error (E_WARNING ,
@@ -5567,34 +5567,34 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
5567
5567
} else if (zend_string_equals_literal (lcname , ZEND_CLONE_FUNC_NAME )) {
5568
5568
ce -> clone = (zend_function * ) op_array ;
5569
5569
} else if (zend_string_equals_literal (lcname , ZEND_CALL_FUNC_NAME )) {
5570
- zend_check_magic_method_attr (fn_flags , "__call" );
5570
+ zend_check_magic_method_attr (fn_flags , "__call" , 0 );
5571
5571
ce -> __call = (zend_function * ) op_array ;
5572
5572
} else if (zend_string_equals_literal (lcname , ZEND_CALLSTATIC_FUNC_NAME )) {
5573
- zend_check_magic_method_attr (fn_flags , "__callStatic" );
5573
+ zend_check_magic_method_attr (fn_flags , "__callStatic" , 1 );
5574
5574
ce -> __callstatic = (zend_function * ) op_array ;
5575
5575
} else if (zend_string_equals_literal (lcname , ZEND_GET_FUNC_NAME )) {
5576
- zend_check_magic_method_attr (fn_flags , "__get" );
5576
+ zend_check_magic_method_attr (fn_flags , "__get" , 0 );
5577
5577
ce -> __get = (zend_function * ) op_array ;
5578
5578
ce -> ce_flags |= ZEND_ACC_USE_GUARDS ;
5579
5579
} else if (zend_string_equals_literal (lcname , ZEND_SET_FUNC_NAME )) {
5580
- zend_check_magic_method_attr (fn_flags , "__set" );
5580
+ zend_check_magic_method_attr (fn_flags , "__set" , 0 );
5581
5581
ce -> __set = (zend_function * ) op_array ;
5582
5582
ce -> ce_flags |= ZEND_ACC_USE_GUARDS ;
5583
5583
} else if (zend_string_equals_literal (lcname , ZEND_UNSET_FUNC_NAME )) {
5584
- zend_check_magic_method_attr (fn_flags , "__unset" );
5584
+ zend_check_magic_method_attr (fn_flags , "__unset" , 0 );
5585
5585
ce -> __unset = (zend_function * ) op_array ;
5586
5586
ce -> ce_flags |= ZEND_ACC_USE_GUARDS ;
5587
5587
} else if (zend_string_equals_literal (lcname , ZEND_ISSET_FUNC_NAME )) {
5588
- zend_check_magic_method_attr (fn_flags , "__isset" );
5588
+ zend_check_magic_method_attr (fn_flags , "__isset" , 0 );
5589
5589
ce -> __isset = (zend_function * ) op_array ;
5590
5590
ce -> ce_flags |= ZEND_ACC_USE_GUARDS ;
5591
5591
} else if (zend_string_equals_literal (lcname , ZEND_TOSTRING_FUNC_NAME )) {
5592
- zend_check_magic_method_attr (fn_flags , "__toString" );
5592
+ zend_check_magic_method_attr (fn_flags , "__toString" , 0 );
5593
5593
ce -> __tostring = (zend_function * ) op_array ;
5594
5594
} else if (zend_string_equals_literal (lcname , ZEND_INVOKE_FUNC_NAME )) {
5595
- zend_check_magic_method_attr (fn_flags , "__invoke" );
5595
+ zend_check_magic_method_attr (fn_flags , "__invoke" , 0 );
5596
5596
} else if (zend_string_equals_literal (lcname , ZEND_DEBUGINFO_FUNC_NAME )) {
5597
- zend_check_magic_method_attr (fn_flags , "__debugInfo" );
5597
+ zend_check_magic_method_attr (fn_flags , "__debugInfo" , 0 );
5598
5598
ce -> __debugInfo = (zend_function * ) op_array ;
5599
5599
}
5600
5600
0 commit comments