diff --git a/ext/standard/var.c b/ext/standard/var.c index e98cb99cf582..9c8cadb3208c 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -764,28 +764,13 @@ static inline bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* static HashTable* php_var_serialize_call_sleep(zend_object *obj, zend_function *fn) /* {{{ */ { - zend_result res; - zend_fcall_info fci; - zend_fcall_info_cache fci_cache; zval retval; - fci.size = sizeof(fci); - fci.object = obj; - fci.retval = &retval; - fci.param_count = 0; - fci.params = NULL; - fci.named_params = NULL; - ZVAL_UNDEF(&fci.function_name); - - fci_cache.function_handler = fn; - fci_cache.object = obj; - fci_cache.called_scope = obj->ce; - BG(serialize_lock)++; - res = zend_call_function(&fci, &fci_cache); + zend_call_known_instance_method(fn, obj, &retval, /* param_count */ 0, /* params */ NULL); BG(serialize_lock)--; - if (res == FAILURE || Z_ISUNDEF(retval)) { + if (Z_ISUNDEF(retval) || EG(exception)) { zval_ptr_dtor(&retval); return NULL; }