@@ -915,47 +915,6 @@ static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
915
915
}
916
916
/* }}} */
917
917
918
- ZEND_API void zend_std_call_user_call (INTERNAL_FUNCTION_PARAMETERS ) /* {{{ */
919
- {
920
- zend_internal_function * func = (zend_internal_function * )EX (func );
921
- zval method_name , method_args ;
922
- zval method_result ;
923
- zend_class_entry * ce = Z_OBJCE_P (getThis ());
924
-
925
- array_init_size (& method_args , ZEND_NUM_ARGS ());
926
-
927
- if (UNEXPECTED (zend_copy_parameters_array (ZEND_NUM_ARGS (), & method_args ) == FAILURE )) {
928
- zval_dtor (& method_args );
929
- zend_error (E_EXCEPTION | E_ERROR , "Cannot get arguments for __call" );
930
- RETURN_FALSE ;
931
- }
932
-
933
- ZVAL_STR (& method_name , func -> function_name ); /* no dup - it's a copy */
934
-
935
- /* __call handler is called with two arguments:
936
- method name
937
- array of method parameters
938
-
939
- */
940
- zend_call_method_with_2_params (getThis (), ce , & ce -> __call , ZEND_CALL_FUNC_NAME , & method_result , & method_name , & method_args );
941
-
942
- if (Z_TYPE (method_result ) != IS_UNDEF ) {
943
- RETVAL_ZVAL_FAST (& method_result );
944
- zval_ptr_dtor (& method_result );
945
- }
946
-
947
- /* now destruct all auxiliaries */
948
- zval_ptr_dtor (& method_args );
949
- zval_ptr_dtor (& method_name );
950
-
951
- /* destruct the function also, then - we have allocated it in get_method */
952
- efree_size (func , sizeof (zend_internal_function ));
953
- #if ZEND_DEBUG
954
- execute_data -> func = NULL ;
955
- #endif
956
- }
957
- /* }}} */
958
-
959
918
/* Ensures that we're allowed to call a private method.
960
919
* Returns the function address that should be called, or NULL
961
920
* if no such function exists.
@@ -1034,12 +993,6 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
1034
993
}
1035
994
/* }}} */
1036
995
1037
- static inline union _zend_function * zend_get_user_call_function (zend_class_entry * ce , zend_string * method_name ) /* {{{ */
1038
- {
1039
- return (union _zend_function * )zend_get_proxy_call_func (ce , method_name , 0 );
1040
- }
1041
- /* }}} */
1042
-
1043
996
static union _zend_function * zend_std_get_method (zend_object * * obj_ptr , zend_string * method_name , const zval * key ) /* {{{ */
1044
997
{
1045
998
zend_object * zobj = * obj_ptr ;
@@ -1063,7 +1016,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
1063
1016
STR_ALLOCA_FREE (lc_method_name , use_heap );
1064
1017
}
1065
1018
if (zobj -> ce -> __call ) {
1066
- return zend_get_user_call_function (zobj -> ce , method_name );
1019
+ return zend_get_proxy_call_func (zobj -> ce , method_name , 0 );
1067
1020
} else {
1068
1021
return NULL ;
1069
1022
}
@@ -1082,7 +1035,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
1082
1035
fbc = updated_fbc ;
1083
1036
} else {
1084
1037
if (zobj -> ce -> __call ) {
1085
- fbc = zend_get_user_call_function (zobj -> ce , method_name );
1038
+ fbc = zend_get_proxy_call_func (zobj -> ce , method_name , 0 );
1086
1039
} else {
1087
1040
zend_error (E_EXCEPTION | E_ERROR , "Call to %s method %s::%s() from context '%s'" , zend_visibility_string (fbc -> common .fn_flags ), ZEND_FN_SCOPE_NAME (fbc ), method_name -> val , EG (scope ) ? EG (scope )-> name -> val : "" );
1088
1041
fbc = NULL ;
@@ -1109,7 +1062,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
1109
1062
*/
1110
1063
if (UNEXPECTED (!zend_check_protected (zend_get_function_root_class (fbc ), EG (scope )))) {
1111
1064
if (zobj -> ce -> __call ) {
1112
- fbc = zend_get_user_call_function (zobj -> ce , method_name );
1065
+ fbc = zend_get_proxy_call_func (zobj -> ce , method_name , 0 );
1113
1066
} else {
1114
1067
zend_error (E_EXCEPTION | E_ERROR , "Call to %s method %s::%s() from context '%s'" , zend_visibility_string (fbc -> common .fn_flags ), ZEND_FN_SCOPE_NAME (fbc ), method_name -> val , EG (scope ) ? EG (scope )-> name -> val : "" );
1115
1068
fbc = NULL ;
@@ -1125,54 +1078,6 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
1125
1078
}
1126
1079
/* }}} */
1127
1080
1128
- ZEND_API void zend_std_callstatic_user_call (INTERNAL_FUNCTION_PARAMETERS ) /* {{{ */
1129
- {
1130
- zend_internal_function * func = (zend_internal_function * )EX (func );
1131
- zval method_name , method_args ;
1132
- zval method_result ;
1133
- zend_class_entry * ce = EG (scope );
1134
-
1135
- array_init_size (& method_args , ZEND_NUM_ARGS ());
1136
-
1137
- if (UNEXPECTED (zend_copy_parameters_array (ZEND_NUM_ARGS (), & method_args ) == FAILURE )) {
1138
- zval_dtor (& method_args );
1139
- zend_error (E_EXCEPTION | E_ERROR , "Cannot get arguments for " ZEND_CALLSTATIC_FUNC_NAME );
1140
- RETURN_FALSE ;
1141
- }
1142
-
1143
- ZVAL_STR (& method_name , func -> function_name ); /* no dup - it's a copy */
1144
-
1145
- /* __callStatic handler is called with two arguments:
1146
- method name
1147
- array of method parameters
1148
- */
1149
- zend_call_method_with_2_params (NULL , ce , & ce -> __callstatic , ZEND_CALLSTATIC_FUNC_NAME , & method_result , & method_name , & method_args );
1150
-
1151
- if (Z_TYPE (method_result ) != IS_UNDEF ) {
1152
- RETVAL_ZVAL_FAST (& method_result );
1153
- zval_ptr_dtor (& method_result );
1154
- }
1155
-
1156
- /* now destruct all auxiliaries */
1157
- zval_ptr_dtor (& method_args );
1158
- zval_ptr_dtor (& method_name );
1159
-
1160
- /* destruct the function also, then - we have allocated it in get_method */
1161
- efree_size (func , sizeof (zend_internal_function ));
1162
- #if ZEND_DEBUG
1163
- execute_data -> func = NULL ;
1164
- #endif
1165
- }
1166
- /* }}} */
1167
-
1168
- static inline union _zend_function * zend_get_user_callstatic_function (zend_class_entry * ce , zend_string * method_name ) /* {{{ */
1169
- {
1170
- return (union _zend_function * )zend_get_proxy_call_func (ce , method_name , 1 );
1171
- }
1172
- /* }}} */
1173
-
1174
- /* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */
1175
-
1176
1081
ZEND_API zend_function * zend_std_get_static_method (zend_class_entry * ce , zend_string * function_name , const zval * key ) /* {{{ */
1177
1082
{
1178
1083
zend_function * fbc = NULL ;
@@ -1207,9 +1112,9 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
1207
1112
if (ce -> __call &&
1208
1113
Z_OBJ (EG (current_execute_data )-> This ) &&
1209
1114
instanceof_function (Z_OBJCE (EG (current_execute_data )-> This ), ce )) {
1210
- return zend_get_user_call_function (ce , function_name );
1115
+ return zend_get_proxy_call_func (ce , function_name , 0 );
1211
1116
} else if (ce -> __callstatic ) {
1212
- return zend_get_user_callstatic_function (ce , function_name );
1117
+ return zend_get_proxy_call_func (ce , function_name , 1 );
1213
1118
} else {
1214
1119
return NULL ;
1215
1120
}
@@ -1235,7 +1140,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
1235
1140
fbc = updated_fbc ;
1236
1141
} else {
1237
1142
if (ce -> __callstatic ) {
1238
- fbc = zend_get_user_callstatic_function (ce , function_name );
1143
+ fbc = zend_get_proxy_call_func (ce , function_name , 1 );
1239
1144
} else {
1240
1145
zend_error (E_EXCEPTION | E_ERROR , "Call to %s method %s::%s() from context '%s'" , zend_visibility_string (fbc -> common .fn_flags ), ZEND_FN_SCOPE_NAME (fbc ), function_name -> val , EG (scope ) ? EG (scope )-> name -> val : "" );
1241
1146
fbc = NULL ;
@@ -1246,7 +1151,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
1246
1151
*/
1247
1152
if (UNEXPECTED (!zend_check_protected (zend_get_function_root_class (fbc ), EG (scope )))) {
1248
1153
if (ce -> __callstatic ) {
1249
- fbc = zend_get_user_callstatic_function (ce , function_name );
1154
+ fbc = zend_get_proxy_call_func (ce , function_name , 1 );
1250
1155
} else {
1251
1156
zend_error (E_EXCEPTION | E_ERROR , "Call to %s method %s::%s() from context '%s'" , zend_visibility_string (fbc -> common .fn_flags ), ZEND_FN_SCOPE_NAME (fbc ), function_name -> val , EG (scope ) ? EG (scope )-> name -> val : "" );
1252
1157
fbc = NULL ;
0 commit comments