[php-src] master: Zend: reuse zend_parse_arg_func() in zend_parse_arg_impl() (#22937)

From: Date: Thu, 30 Jul 2026 12:28:03 +0000
Subject: [php-src] master: Zend: reuse zend_parse_arg_func() in zend_parse_arg_impl() (#22937)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-140339@lists.php.net to get a copy of this message
Author: Gina Peter Banyard (Girgias) Committer: GitHub (web-flow) Pusher: Girgias Date: 2026-07-30T13:28:00+01:00 Commit: https://github.com/php/php-src/commit/346227583da55ed8b4494dd8033ff26dd725bae1 Raw diff: https://github.com/php/php-src/commit/346227583da55ed8b4494dd8033ff26dd725bae1.diff Zend: reuse zend_parse_arg_func() in zend_parse_arg_impl() (#22937) No need to duplicate the logic Changed paths: M Zend/zend_API.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 72f4727eeddf..33128e4a7e37 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1058,21 +1058,8 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec zend_fcall_info *fci = va_arg(*va, zend_fcall_info *); zend_fcall_info_cache *fcc = va_arg(*va, zend_fcall_info_cache *); char *is_callable_error = NULL; - - if (check_null && Z_TYPE_P(arg) == IS_NULL) { - fci->size = 0; - fcc->function_handler = 0; - break; - } - - if (zend_fcall_info_init(arg, 0, fci, fcc, NULL, &is_callable_error) == SUCCESS) { + if (EXPECTED(zend_parse_arg_func(arg, fci, fcc, check_null, &is_callable_error, c == 'f'))) { ZEND_ASSERT(!is_callable_error); - if (c == 'f') { - /* Release call trampolines: The function may not get called, in which case - * the trampoline will leak. Force it to be refetched during - * zend_call_function instead. */ - zend_release_fcall_info_cache(fcc); - } break; }

« previous php.cvs (#140339) next »