@@ -179,6 +179,8 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
179
179
{
180
180
zend_class_entry * ce = Z_OBJCE_P (object );
181
181
zend_class_entry * orig_fake_scope = EG (fake_scope );
182
+ zend_fcall_info fci ;
183
+ zend_fcall_info_cache fcic ;
182
184
183
185
EG (fake_scope ) = NULL ;
184
186
@@ -187,7 +189,20 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
187
189
188
190
it should return whether the call was successful or not
189
191
*/
190
- zend_call_method_with_1_params (object , ce , & ce -> __get , ZEND_GET_FUNC_NAME , retval , member );
192
+
193
+ fci .size = sizeof (fci );
194
+ fci .object = Z_OBJ_P (object );
195
+ fci .retval = retval ;
196
+ fci .param_count = 1 ;
197
+ fci .params = member ;
198
+ fci .no_separation = 1 ;
199
+ ZVAL_UNDEF (& fci .function_name ); /* Unused */
200
+
201
+ fcic .function_handler = ce -> __get ;
202
+ fcic .called_scope = ce ;
203
+ fcic .object = Z_OBJ_P (object );
204
+
205
+ zend_call_function (& fci , & fcic );
191
206
192
207
EG (fake_scope ) = orig_fake_scope ;
193
208
}
@@ -197,14 +212,35 @@ static void zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
197
212
{
198
213
zend_class_entry * ce = Z_OBJCE_P (object );
199
214
zend_class_entry * orig_fake_scope = EG (fake_scope );
215
+ zend_fcall_info fci ;
216
+ zend_fcall_info_cache fcic ;
217
+ zval args [2 ], ret ;
200
218
201
219
EG (fake_scope ) = NULL ;
202
220
203
221
/* __set handler is called with two arguments:
204
222
property name
205
223
value to be set
206
224
*/
207
- zend_call_method_with_2_params (object , ce , & ce -> __set , ZEND_SET_FUNC_NAME , NULL , member , value );
225
+
226
+ ZVAL_COPY_VALUE (& args [0 ], member );
227
+ ZVAL_COPY_VALUE (& args [1 ], value );
228
+ ZVAL_UNDEF (& ret );
229
+
230
+ fci .size = sizeof (fci );
231
+ fci .object = Z_OBJ_P (object );
232
+ fci .retval = & ret ;
233
+ fci .param_count = 2 ;
234
+ fci .params = args ;
235
+ fci .no_separation = 1 ;
236
+ ZVAL_UNDEF (& fci .function_name ); /* Unused */
237
+
238
+ fcic .function_handler = ce -> __set ;
239
+ fcic .called_scope = ce ;
240
+ fcic .object = Z_OBJ_P (object );
241
+
242
+ zend_call_function (& fci , & fcic );
243
+ zval_ptr_dtor (& ret );
208
244
209
245
EG (fake_scope ) = orig_fake_scope ;
210
246
}
@@ -214,14 +250,32 @@ static void zend_std_call_unsetter(zval *object, zval *member) /* {{{ */
214
250
{
215
251
zend_class_entry * ce = Z_OBJCE_P (object );
216
252
zend_class_entry * orig_fake_scope = EG (fake_scope );
253
+ zend_fcall_info fci ;
254
+ zend_fcall_info_cache fcic ;
255
+ zval ret ;
217
256
218
257
EG (fake_scope ) = NULL ;
219
258
220
259
/* __unset handler is called with one argument:
221
260
property name
222
261
*/
223
262
224
- zend_call_method_with_1_params (object , ce , & ce -> __unset , ZEND_UNSET_FUNC_NAME , NULL , member );
263
+ ZVAL_UNDEF (& ret );
264
+
265
+ fci .size = sizeof (fci );
266
+ fci .object = Z_OBJ_P (object );
267
+ fci .retval = & ret ;
268
+ fci .param_count = 1 ;
269
+ fci .params = member ;
270
+ fci .no_separation = 1 ;
271
+ ZVAL_UNDEF (& fci .function_name ); /* Unused */
272
+
273
+ fcic .function_handler = ce -> __unset ;
274
+ fcic .called_scope = ce ;
275
+ fcic .object = Z_OBJ_P (object );
276
+
277
+ zend_call_function (& fci , & fcic );
278
+ zval_ptr_dtor (& ret );
225
279
226
280
EG (fake_scope ) = orig_fake_scope ;
227
281
}
@@ -231,6 +285,8 @@ static void zend_std_call_issetter(zval *object, zval *member, zval *retval) /*
231
285
{
232
286
zend_class_entry * ce = Z_OBJCE_P (object );
233
287
zend_class_entry * orig_fake_scope = EG (fake_scope );
288
+ zend_fcall_info fci ;
289
+ zend_fcall_info_cache fcic ;
234
290
235
291
EG (fake_scope ) = NULL ;
236
292
@@ -240,7 +296,19 @@ static void zend_std_call_issetter(zval *object, zval *member, zval *retval) /*
240
296
it should return whether the property is set or not
241
297
*/
242
298
243
- zend_call_method_with_1_params (object , ce , & ce -> __isset , ZEND_ISSET_FUNC_NAME , retval , member );
299
+ fci .size = sizeof (fci );
300
+ fci .object = Z_OBJ_P (object );
301
+ fci .retval = retval ;
302
+ fci .param_count = 1 ;
303
+ fci .params = member ;
304
+ fci .no_separation = 1 ;
305
+ ZVAL_UNDEF (& fci .function_name ); /* Unused */
306
+
307
+ fcic .function_handler = ce -> __isset ;
308
+ fcic .called_scope = ce ;
309
+ fcic .object = Z_OBJ_P (object );
310
+
311
+ zend_call_function (& fci , & fcic );
244
312
245
313
EG (fake_scope ) = orig_fake_scope ;
246
314
}
0 commit comments