@@ -2008,63 +2008,64 @@ ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *mod
2008
2008
/* }}} */
2009
2009
2010
2010
static void zend_check_magic_method_args (
2011
- uint32_t num_args , const char * name ,
2012
- const zend_class_entry * ce , const zend_function * fptr , int error_type )
2011
+ uint32_t num_args , const zend_class_entry * ce , const zend_function * fptr , int error_type )
2013
2012
{
2014
2013
if (fptr -> common .num_args != num_args ) {
2015
2014
if (num_args == 0 ) {
2016
2015
zend_error (error_type , "Method %s::%s() cannot take arguments" ,
2017
- ZSTR_VAL (ce -> name ), name );
2016
+ ZSTR_VAL (ce -> name ), ZSTR_VAL ( fptr -> common . function_name ) );
2018
2017
} else if (num_args == 1 ) {
2019
2018
zend_error (error_type , "Method %s::%s() must take exactly 1 argument" ,
2020
- ZSTR_VAL (ce -> name ), name );
2019
+ ZSTR_VAL (ce -> name ), ZSTR_VAL ( fptr -> common . function_name ) );
2021
2020
} else {
2022
2021
zend_error (error_type , "Method %s::%s() must take exactly %" PRIu32 " arguments" ,
2023
- ZSTR_VAL (ce -> name ), name , num_args );
2022
+ ZSTR_VAL (ce -> name ), ZSTR_VAL ( fptr -> common . function_name ) , num_args );
2024
2023
}
2025
2024
return ;
2026
2025
}
2027
2026
for (uint32_t i = 0 ; i < num_args ; i ++ ) {
2028
2027
if (QUICK_ARG_SHOULD_BE_SENT_BY_REF (fptr , i + 1 )) {
2029
2028
zend_error (error_type , "Method %s::%s() cannot take arguments by reference" ,
2030
- ZSTR_VAL (ce -> name ), name );
2029
+ ZSTR_VAL (ce -> name ), ZSTR_VAL ( fptr -> common . function_name ) );
2031
2030
return ;
2032
2031
}
2033
2032
}
2034
2033
}
2035
2034
2036
2035
static void zend_check_magic_method_non_static (
2037
- const char * name , const zend_class_entry * ce , const zend_function * fptr , int error_type )
2036
+ const zend_class_entry * ce , const zend_function * fptr , int error_type )
2038
2037
{
2039
2038
if (fptr -> common .fn_flags & ZEND_ACC_STATIC ) {
2040
- zend_error (error_type , "Method %s::%s() cannot be static" , ZSTR_VAL (ce -> name ), name );
2039
+ zend_error (error_type , "Method %s::%s() cannot be static" ,
2040
+ ZSTR_VAL (ce -> name ), ZSTR_VAL (fptr -> common .function_name ));
2041
2041
}
2042
2042
}
2043
2043
2044
2044
static void zend_check_magic_method_static (
2045
- const char * name , const zend_class_entry * ce , const zend_function * fptr , int error_type )
2045
+ const zend_class_entry * ce , const zend_function * fptr , int error_type )
2046
2046
{
2047
2047
if (!(fptr -> common .fn_flags & ZEND_ACC_STATIC )) {
2048
- zend_error (error_type , "Method %s::%s() must be static" , ZSTR_VAL (ce -> name ), name );
2048
+ zend_error (error_type , "Method %s::%s() must be static" ,
2049
+ ZSTR_VAL (ce -> name ), ZSTR_VAL (fptr -> common .function_name ));
2049
2050
}
2050
2051
}
2051
2052
2052
2053
static void zend_check_magic_method_public (
2053
- const char * name , const zend_class_entry * ce , const zend_function * fptr , int error_type )
2054
+ const zend_class_entry * ce , const zend_function * fptr , int error_type )
2054
2055
{
2055
2056
// TODO: Remove this warning after adding proper visibility handling.
2056
2057
if (!(fptr -> common .fn_flags & ZEND_ACC_PUBLIC )) {
2057
2058
zend_error (E_WARNING , "The magic method %s::%s() must have public visibility" ,
2058
- ZSTR_VAL (ce -> name ), name );
2059
+ ZSTR_VAL (ce -> name ), ZSTR_VAL ( fptr -> common . function_name ) );
2059
2060
}
2060
2061
}
2061
2062
2062
2063
static void zend_check_magic_method_no_return_type (
2063
- const char * name , const zend_class_entry * ce , const zend_function * fptr , int error_type )
2064
+ const zend_class_entry * ce , const zend_function * fptr , int error_type )
2064
2065
{
2065
2066
if (fptr -> common .fn_flags & ZEND_ACC_HAS_RETURN_TYPE ) {
2066
2067
zend_error_noreturn (error_type , "Method %s::%s() cannot declare a return type" ,
2067
- ZSTR_VAL (ce -> name ), name );
2068
+ ZSTR_VAL (ce -> name ), ZSTR_VAL ( fptr -> common . function_name ) );
2068
2069
}
2069
2070
}
2070
2071
@@ -2076,63 +2077,63 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
2076
2077
}
2077
2078
2078
2079
if (zend_string_equals_literal (lcname , ZEND_CONSTRUCTOR_FUNC_NAME )) {
2079
- zend_check_magic_method_non_static ("__construct" , ce , fptr , error_type );
2080
- zend_check_magic_method_no_return_type ("__construct" , ce , fptr , error_type );
2080
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2081
+ zend_check_magic_method_no_return_type (ce , fptr , error_type );
2081
2082
} else if (zend_string_equals_literal (lcname , ZEND_DESTRUCTOR_FUNC_NAME )) {
2082
- zend_check_magic_method_args (0 , "__destruct" , ce , fptr , error_type );
2083
- zend_check_magic_method_non_static ("__destruct" , ce , fptr , error_type );
2084
- zend_check_magic_method_no_return_type ("__destruct" , ce , fptr , error_type );
2083
+ zend_check_magic_method_args (0 , ce , fptr , error_type );
2084
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2085
+ zend_check_magic_method_no_return_type (ce , fptr , error_type );
2085
2086
} else if (zend_string_equals_literal (lcname , ZEND_CLONE_FUNC_NAME )) {
2086
- zend_check_magic_method_args (0 , "__clone" , ce , fptr , error_type );
2087
- zend_check_magic_method_non_static ("__clone" , ce , fptr , error_type );
2088
- zend_check_magic_method_no_return_type ("__clone" , ce , fptr , error_type );
2087
+ zend_check_magic_method_args (0 , ce , fptr , error_type );
2088
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2089
+ zend_check_magic_method_no_return_type (ce , fptr , error_type );
2089
2090
} else if (zend_string_equals_literal (lcname , ZEND_GET_FUNC_NAME )) {
2090
- zend_check_magic_method_args (1 , "__get" , ce , fptr , error_type );
2091
- zend_check_magic_method_non_static ("__get" , ce , fptr , error_type );
2092
- zend_check_magic_method_public ("__get" , ce , fptr , error_type );
2091
+ zend_check_magic_method_args (1 , ce , fptr , error_type );
2092
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2093
+ zend_check_magic_method_public (ce , fptr , error_type );
2093
2094
} else if (zend_string_equals_literal (lcname , ZEND_SET_FUNC_NAME )) {
2094
- zend_check_magic_method_args (2 , "__set" , ce , fptr , error_type );
2095
- zend_check_magic_method_non_static ("__set" , ce , fptr , error_type );
2096
- zend_check_magic_method_public ("__set" , ce , fptr , error_type );
2095
+ zend_check_magic_method_args (2 , ce , fptr , error_type );
2096
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2097
+ zend_check_magic_method_public (ce , fptr , error_type );
2097
2098
} else if (zend_string_equals_literal (lcname , ZEND_UNSET_FUNC_NAME )) {
2098
- zend_check_magic_method_args (1 , "__unset" , ce , fptr , error_type );
2099
- zend_check_magic_method_non_static ("__unset" , ce , fptr , error_type );
2100
- zend_check_magic_method_public ("__unset" , ce , fptr , error_type );
2099
+ zend_check_magic_method_args (1 , ce , fptr , error_type );
2100
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2101
+ zend_check_magic_method_public (ce , fptr , error_type );
2101
2102
} else if (zend_string_equals_literal (lcname , ZEND_ISSET_FUNC_NAME )) {
2102
- zend_check_magic_method_args (1 , "__isset" , ce , fptr , error_type );
2103
- zend_check_magic_method_non_static ("__isset" , ce , fptr , error_type );
2104
- zend_check_magic_method_public ("__isset" , ce , fptr , error_type );
2103
+ zend_check_magic_method_args (1 , ce , fptr , error_type );
2104
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2105
+ zend_check_magic_method_public (ce , fptr , error_type );
2105
2106
} else if (zend_string_equals_literal (lcname , ZEND_CALL_FUNC_NAME )) {
2106
- zend_check_magic_method_args (2 , "__call" , ce , fptr , error_type );
2107
- zend_check_magic_method_non_static ("__call" , ce , fptr , error_type );
2108
- zend_check_magic_method_public ("__call" , ce , fptr , error_type );
2107
+ zend_check_magic_method_args (2 , ce , fptr , error_type );
2108
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2109
+ zend_check_magic_method_public (ce , fptr , error_type );
2109
2110
} else if (zend_string_equals_literal (lcname , ZEND_CALLSTATIC_FUNC_NAME )) {
2110
- zend_check_magic_method_args (2 , "__callStatic" , ce , fptr , error_type );
2111
- zend_check_magic_method_static ("__callStatic" , ce , fptr , error_type );
2112
- zend_check_magic_method_public ("__callStatic" , ce , fptr , error_type );
2111
+ zend_check_magic_method_args (2 , ce , fptr , error_type );
2112
+ zend_check_magic_method_static (ce , fptr , error_type );
2113
+ zend_check_magic_method_public (ce , fptr , error_type );
2113
2114
} else if (zend_string_equals_literal (lcname , ZEND_TOSTRING_FUNC_NAME )) {
2114
- zend_check_magic_method_args (0 , "__toString" , ce , fptr , error_type );
2115
- zend_check_magic_method_non_static ("__toString" , ce , fptr , error_type );
2116
- zend_check_magic_method_public ("__toString" , ce , fptr , error_type );
2115
+ zend_check_magic_method_args (0 , ce , fptr , error_type );
2116
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2117
+ zend_check_magic_method_public (ce , fptr , error_type );
2117
2118
} else if (zend_string_equals_literal (lcname , ZEND_DEBUGINFO_FUNC_NAME )) {
2118
- zend_check_magic_method_args (0 , "__debugInfo" , ce , fptr , error_type );
2119
- zend_check_magic_method_non_static ("__debugInfo" , ce , fptr , error_type );
2120
- zend_check_magic_method_public ("__debugInfo" , ce , fptr , error_type );
2119
+ zend_check_magic_method_args (0 , ce , fptr , error_type );
2120
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2121
+ zend_check_magic_method_public (ce , fptr , error_type );
2121
2122
} else if (zend_string_equals_literal (lcname , "__serialize" )) {
2122
- zend_check_magic_method_args (0 , "__serialize" , ce , fptr , error_type );
2123
- zend_check_magic_method_non_static ("__serialize" , ce , fptr , error_type );
2124
- zend_check_magic_method_public ("__serialize" , ce , fptr , error_type );
2123
+ zend_check_magic_method_args (0 , ce , fptr , error_type );
2124
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2125
+ zend_check_magic_method_public (ce , fptr , error_type );
2125
2126
} else if (zend_string_equals_literal (lcname , "__unserialize" )) {
2126
- zend_check_magic_method_args (1 , "__unserialize" , ce , fptr , error_type );
2127
- zend_check_magic_method_non_static ("__unserialize" , ce , fptr , error_type );
2128
- zend_check_magic_method_public ("__unserialize" , ce , fptr , error_type );
2127
+ zend_check_magic_method_args (1 , ce , fptr , error_type );
2128
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2129
+ zend_check_magic_method_public (ce , fptr , error_type );
2129
2130
} else if (zend_string_equals_literal (lcname , "__set_state" )) {
2130
- zend_check_magic_method_args (1 , "__set_state" , ce , fptr , error_type );
2131
- zend_check_magic_method_static ("__set_state" , ce , fptr , error_type );
2132
- zend_check_magic_method_public ("__set_state" , ce , fptr , error_type );
2131
+ zend_check_magic_method_args (1 , ce , fptr , error_type );
2132
+ zend_check_magic_method_static (ce , fptr , error_type );
2133
+ zend_check_magic_method_public (ce , fptr , error_type );
2133
2134
} else if (zend_string_equals_literal (lcname , "__invoke" )) {
2134
- zend_check_magic_method_non_static ("__invoke" , ce , fptr , error_type );
2135
- zend_check_magic_method_public ("__invoke" , ce , fptr , error_type );
2135
+ zend_check_magic_method_non_static (ce , fptr , error_type );
2136
+ zend_check_magic_method_public (ce , fptr , error_type );
2136
2137
}
2137
2138
}
2138
2139
/* }}} */
0 commit comments