Skip to content

Commit 00f7b0d

Browse files
committed
Don't unnecessary fetch error in is_callable()
As we just end up freeing it afterwards, avoid populating it in the first place.
1 parent e41f7e5 commit 00f7b0d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ext/standard/type.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ PHP_FUNCTION(is_callable)
402402
{
403403
zval *var, *callable_name = NULL;
404404
zend_string *name;
405-
char *error;
406405
bool retval;
407406
bool syntax_only = 0;
408407
int check_flags = 0;
@@ -418,14 +417,10 @@ PHP_FUNCTION(is_callable)
418417
check_flags |= IS_CALLABLE_CHECK_SYNTAX_ONLY;
419418
}
420419
if (ZEND_NUM_ARGS() > 2) {
421-
retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error);
420+
retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, NULL);
422421
ZEND_TRY_ASSIGN_REF_STR(callable_name, name);
423422
} else {
424-
retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error);
425-
}
426-
if (error) {
427-
/* ignore errors */
428-
efree(error);
423+
retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, NULL);
429424
}
430425

431426
RETURN_BOOL(retval);

0 commit comments

Comments
 (0)