Skip to content

Commit 5df23ef

Browse files
committed
Zend: drop unused check_only parameter from zend_closure_get_closure()
1 parent d3e4703 commit 5df23ef

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4184,7 +4184,7 @@ ZEND_API bool zend_is_callable_at_frame(
41844184
}
41854185
return 0;
41864186
case IS_OBJECT:
4187-
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) {
4187+
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) {
41884188
fcc->called_scope = fcc->calling_scope;
41894189
fcc->closure = Z_OBJ_P(callable);
41904190
if (fcc == &fcc_local) {

Zend/zend_closures.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct _zend_closure {
4040
ZEND_API zend_class_entry *zend_ce_closure;
4141
static zend_object_handlers closure_handlers;
4242

43-
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);
43+
static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr);
4444

4545
ZEND_METHOD(Closure, __invoke) /* {{{ */
4646
{
@@ -56,7 +56,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
5656
zend_fcall_info_cache fcc = {
5757
.closure = Z_OBJ_P(ZEND_THIS),
5858
};
59-
zend_closure_get_closure(Z_OBJ_P(ZEND_THIS), &fcc.calling_scope, &fcc.function_handler, &fcc.object, false);
59+
zend_closure_get_closure(Z_OBJ_P(ZEND_THIS), &fcc.calling_scope, &fcc.function_handler, &fcc.object);
6060
fcc.called_scope = fcc.calling_scope;
6161
zend_call_known_fcc(&fcc, return_value, num_args, args, named_args);
6262

@@ -594,7 +594,7 @@ static zend_object *zend_closure_clone(zend_object *zobject) /* {{{ */
594594
}
595595
/* }}} */
596596

597-
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) /* {{{ */
597+
static zend_result zend_closure_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */
598598
{
599599
zend_closure *closure = (zend_closure*)obj;
600600

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5158,7 +5158,7 @@ static zend_never_inline zend_execute_data *zend_init_dynamic_call_object(zend_o
51585158
uint32_t call_info;
51595159

51605160
if (EXPECTED(function->handlers->get_closure) &&
5161-
EXPECTED(function->handlers->get_closure(function, &called_scope, &fbc, &object, 0) == SUCCESS)) {
5161+
EXPECTED(function->handlers->get_closure(function, &called_scope, &fbc, &object) == SUCCESS)) {
51625162

51635163
object_or_called_scope = called_scope;
51645164
if (EXPECTED(fbc->common.fn_flags & ZEND_ACC_CLOSURE)) {

Zend/zend_object_handlers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2482,7 +2482,7 @@ ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *w
24822482
}
24832483
/* }}} */
24842484

2485-
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) /* {{{ */
2485+
ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr) /* {{{ */
24862486
{
24872487
zend_class_entry *ce = obj->ce;
24882488
const zval *func = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));

Zend/zend_object_handlers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ typedef zend_result (*zend_object_cast_t)(zend_object *readobj, zval *retval, in
197197
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
198198
typedef zend_result (*zend_object_count_elements_t)(zend_object *object, zend_long *count);
199199

200-
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);
200+
typedef zend_result (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr);
201201

202202
typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n);
203203

@@ -271,7 +271,7 @@ ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset);
271271
ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key);
272272
ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj);
273273
ZEND_API int zend_std_compare_objects(zval *o1, zval *o2);
274-
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);
274+
ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr);
275275
/* Use zend_std_get_properties_ex() */
276276
ZEND_API HashTable *rebuild_object_properties_internal(zend_object *zobj);
277277
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);

ext/reflection/php_reflection.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureCalledClass)
18581858
zend_function *closure_func;
18591859
zend_object *object;
18601860
if (Z_OBJ_HANDLER(intern->obj, get_closure)
1861-
&& Z_OBJ_HANDLER(intern->obj, get_closure)(Z_OBJ(intern->obj), &called_scope, &closure_func, &object, 1) == SUCCESS
1861+
&& Z_OBJ_HANDLER(intern->obj, get_closure)(Z_OBJ(intern->obj), &called_scope, &closure_func, &object) == SUCCESS
18621862
&& closure_func && (called_scope || closure_func->common.scope)) {
18631863
zend_reflection_class_factory(called_scope ? (zend_class_entry *) called_scope : closure_func->common.scope, return_value);
18641864
}
@@ -2118,7 +2118,7 @@ ZEND_METHOD(ReflectionFunction, invoke)
21182118

21192119
if (!Z_ISUNDEF(intern->obj)) {
21202120
Z_OBJ_HT(intern->obj)->get_closure(
2121-
Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object, 0);
2121+
Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object);
21222122
}
21232123

21242124
zend_call_known_fcc(&fcc, &retval, num_args, params, named_params);
@@ -2151,7 +2151,7 @@ ZEND_METHOD(ReflectionFunction, invokeArgs)
21512151

21522152
if (!Z_ISUNDEF(intern->obj)) {
21532153
Z_OBJ_HT(intern->obj)->get_closure(
2154-
Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object, 0);
2154+
Z_OBJ(intern->obj), &fcc.called_scope, &fcc.function_handler, &fcc.object);
21552155
}
21562156

21572157
zend_call_known_fcc(&fcc, &retval, /* num_params */ 0, /* params */ NULL, params);

0 commit comments

Comments
 (0)