diff --git a/Zend/zend_API.c b/Zend/zend_API.c index e72043ead587..321a33d7591e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4184,7 +4184,7 @@ ZEND_API bool zend_is_callable_at_frame( } return 0; case IS_OBJECT: - if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(Z_OBJ_P(callable), &fcc->calling_scope, &fcc->function_handler, &fcc->object, 1) == SUCCESS) { + if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(Z_OBJ_P(callable), &fcc->calling_scope, &fcc->function_handler, &fcc->object) == SUCCESS) { fcc->called_scope = fcc->calling_scope; fcc->closure = Z_OBJ_P(callable); if (fcc == &fcc_local) { diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index cca69985a0df..9b71f35e3bc8 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -40,7 +40,7 @@ typedef struct _zend_closure { ZEND_API zend_class_entry *zend_ce_closure; static zend_object_handlers closure_handlers; -static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only); +static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr); ZEND_METHOD(Closure, __invoke) /* {{{ */ { @@ -56,7 +56,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */ zend_fcall_info_cache fcc = { .closure = Z_OBJ_P(ZEND_THIS), }; - zend_closure_get_closure(Z_OBJ_P(ZEND_THIS), &fcc.calling_scope, &fcc.function_handler, &fcc.object, false); + zend_closure_get_closure(Z_OBJ_P(ZEND_THIS), &fcc.calling_scope, &fcc.function_handler, &fcc.object); fcc.called_scope = fcc.calling_scope; zend_call_known_fcc(&fcc, return_value, num_args, args, named_args); @@ -594,7 +594,7 @@ static zend_object *zend_closure_clone(zend_object *zobject) /* {{{ */ } /* }}} */ -static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */ +static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */ { zend_closure *closure = (zend_closure*)obj; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 37278c5cb9a2..948a1f840d2c 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -5158,7 +5158,7 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_object(zend_o uint32_t call_info; if (EXPECTED(function->handlers->get_closure) && - EXPECTED(function->handlers->get_closure(function, &called_scope, &fbc, &object, 0) == SUCCESS)) { + EXPECTED(function->handlers->get_closure(function, &called_scope, &fbc, &object) == SUCCESS)) { object_or_called_scope = called_scope; if (EXPECTED(fbc->common.fn_flags & ZEND_ACC_CLOSURE)) { diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 45eac02949d1..02e429a0940c 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2482,7 +2482,7 @@ ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *w } /* }}} */ -ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */ +ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */ { zend_class_entry *ce = obj->ce; const zval *func = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE)); diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 3e922343eb15..573ecda6319f 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -197,7 +197,7 @@ typedef zend_result (*zend_object_cast_t)(zend_object *readobj, zval *retval, in * Returns FAILURE if the object does not have any sense of overloaded dimensions */ typedef zend_result (*zend_object_count_elements_t)(zend_object *object, zend_long *count); -typedef zend_result (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only); +typedef zend_result (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr); typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n); @@ -271,7 +271,7 @@ ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset); ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key); ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj); ZEND_API int zend_std_compare_objects(zval *o1, zval *o2); -ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only); +ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr); /* Use zend_std_get_properties_ex() */ ZEND_API HashTable *rebuild_object_properties_internal(zend_object *zobj); ZEND_API ZEND_COLD zend_never_inline void zend_bad_method_call(const zend_function *fbc, const zend_string *method_name, const zend_class_entry *scope); diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 256468e39a44..9d69d91677f6 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1858,7 +1858,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureCalledClass) zend_function *closure_func; zend_object *object; if (Z_OBJ_HANDLER(intern->obj, get_closure) - && Z_OBJ_HANDLER(intern->obj, get_closure)(Z_OBJ(intern->obj), &called_scope, &closure_func, &object, 1) == SUCCESS + && Z_OBJ_HANDLER(intern->obj, get_closure)(Z_OBJ(intern->obj), &called_scope, &closure_func, &object) == SUCCESS && closure_func && (called_scope || closure_func->common.scope)) { zend_reflection_class_factory(called_scope ? (zend_class_entry *) called_scope : closure_func->common.scope, return_value); } @@ -2118,7 +2118,7 @@ ZEND_METHOD(ReflectionFunction, invoke) if (!Z_ISUNDEF(intern->obj)) { Z_OBJ_HT(intern->obj)->get_closure( - Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object, 0); + Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object); } zend_call_known_fcc(&fcc, &retval, num_args, params, named_params); @@ -2151,7 +2151,7 @@ ZEND_METHOD(ReflectionFunction, invokeArgs) if (!Z_ISUNDEF(intern->obj)) { Z_OBJ_HT(intern->obj)->get_closure( - Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object, 0); + Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object); } zend_call_known_fcc(&fcc, &retval, /* num_params */ 0, /* params */ NULL, params);