summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2021-02-20 13:59:29 +0300
committerDmitry Stogov <dmitry@zend.com>2021-02-20 13:59:29 +0300
commitac7e967b675816de7750b96102bdd1317bb65795 (patch)
treeda2991c7e583a7961640b2552c1bb5a8fae0506f /ext
parentf37fe68e6300e6a347dffecf8d7788da0ab0a02d (diff)
downloadphp-git-ac7e967b675816de7750b96102bdd1317bb65795.tar.gz
Reduce ZPP API overhead
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/zend_accelerator_module.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 1abbb5bb64..cdb63f7b88 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -332,15 +332,14 @@ static int filename_is_in_cache(zend_string *filename)
static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS)
{
- zval zfilename;
+ if (ZEND_NUM_ARGS() == 1) {
+ zval *zv = ZEND_CALL_ARG(execute_data , 1);
- if (ZEND_NUM_ARGS() != 1 ||
- zend_get_parameters_array_ex(1, &zfilename) == FAILURE ||
- Z_TYPE(zfilename) != IS_STRING ||
- Z_STRLEN(zfilename) == 0) {
- return 0;
+ if (Z_TYPE_P(zv) == IS_STRING && Z_STRLEN_P(zv) != 0) {
+ return filename_is_in_cache(Z_STR_P(zv));
+ }
}
- return filename_is_in_cache(Z_STR(zfilename));
+ return 0;
}
static ZEND_NAMED_FUNCTION(accel_file_exists)