From 412745300897ec2f8d1f5345463e0e82734e0cfc Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 22 Dec 2025 00:13:56 +0100 Subject: [PATCH 1/4] docs: add OPCache file cache and JIT blacklist functions Add documentation for two new OPCache functions: - opcache_is_script_cached_in_file_cache: checks if a script is cached in OPCache file cache - opcache_jit_blacklist: blacklists a function from being JIT compiled Update opcache_is_script_cached documentation to clarify it checks in-memory cache and cross-reference the new file cache function. --- ...opcache-is-script-cached-in-file-cache.xml | 74 ++++++++++++++++ .../functions/opcache-is-script-cached.xml | 8 +- .../functions/opcache-jit-blacklist.xml | 84 +++++++++++++++++++ 3 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 reference/opcache/functions/opcache-is-script-cached-in-file-cache.xml create mode 100644 reference/opcache/functions/opcache-jit-blacklist.xml diff --git a/reference/opcache/functions/opcache-is-script-cached-in-file-cache.xml b/reference/opcache/functions/opcache-is-script-cached-in-file-cache.xml new file mode 100644 index 000000000000..f94c4ea929d4 --- /dev/null +++ b/reference/opcache/functions/opcache-is-script-cached-in-file-cache.xml @@ -0,0 +1,74 @@ + + + + + opcache_is_script_cached_in_file_cache + Tells whether a script is cached in OPCache file cache + + + + &reftitle.description; + + boolopcache_is_script_cached_in_file_cache + stringfilename + + + This function checks if a PHP script has been cached in OPCache. This can be + used to more easily detect the "warming" of the cache for a particular script. + This function only checks file cache cache, not in-memory cache. In order to + check in-memory cache, use opcache_is_script_cached. + + + + + &reftitle.parameters; + + + filename + + + The path to the PHP script to be checked. + + + + + + + + &reftitle.returnvalues; + + Returns &true; if filename is cached in OPCache, + &false; otherwise. + + + + + &reftitle.seealso; + + + opcache_compile_file + opcache_is_script_cached + + + + + diff --git a/reference/opcache/functions/opcache-is-script-cached.xml b/reference/opcache/functions/opcache-is-script-cached.xml index 03df796c2128..d18be80ee0e4 100644 --- a/reference/opcache/functions/opcache-is-script-cached.xml +++ b/reference/opcache/functions/opcache-is-script-cached.xml @@ -13,9 +13,10 @@ stringfilename - This function checks if a PHP script has been cached in OPCache. This can be + This function checks if a PHP script has been cached in OPCache in-memory cache. This can be used to more easily detect the "warming" of the cache for a particular script. - This function only checks in-memory cache, not file cache. + This function only checks in-memory cache, not file cache. In order to + check file cache, use opcache_is_script_cached_in_file_cache. @@ -36,7 +37,7 @@ &reftitle.returnvalues; - Returns &true; if filename is cached in OPCache, + Returns &true; if filename is cached in OPCache in-memory cache, &false; otherwise. @@ -46,6 +47,7 @@ opcache_compile_file + opcache_is_script_cached_in_file_cache diff --git a/reference/opcache/functions/opcache-jit-blacklist.xml b/reference/opcache/functions/opcache-jit-blacklist.xml new file mode 100644 index 000000000000..61f7fb5fb56d --- /dev/null +++ b/reference/opcache/functions/opcache-jit-blacklist.xml @@ -0,0 +1,84 @@ + + + + + opcache_jit_blacklist + Blacklists a function from being JIT compiled + + + + &reftitle.description; + + voidopcache_jit_blacklist + Closureclosure + + + This function blacklists a particular function from being JIT compiled. + The function is specified using a Closure. + + + + + &reftitle.parameters; + + + closure + + + + + + + + + + &reftitle.examples; + + <function>opcache_jit_blacklist</function> basic example + + +]]> + + + + + + &reftitle.seealso; + + + opcache_invalidate + opcache_reset + + + + + From 17839f1ca5b92b80c527499b47e248569072784a Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 22 Dec 2025 00:33:59 +0100 Subject: [PATCH 2/4] docs: add opcache functions introduced in PHP 8.4 and 8.5 Add version information for two new opcache functions: - opcache_is_script_cached_in_file_cache (PHP 8.5.0+) - opcache_jit_blacklist (PHP 8.4.0+) --- reference/opcache/versions.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/opcache/versions.xml b/reference/opcache/versions.xml index 9a5363ab1342..36aa3ea44739 100644 --- a/reference/opcache/versions.xml +++ b/reference/opcache/versions.xml @@ -9,6 +9,8 @@ + + + From f224e0b2b94df7dc41a2a30e24471589100553f9 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sat, 27 Dec 2025 00:58:56 +0100 Subject: [PATCH 4/4] style: remove trailing whitespace in opcache-jit-blacklist.xml --- reference/opcache/functions/opcache-jit-blacklist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/opcache/functions/opcache-jit-blacklist.xml b/reference/opcache/functions/opcache-jit-blacklist.xml index 67cad4002b45..3a39223fc8cb 100644 --- a/reference/opcache/functions/opcache-jit-blacklist.xml +++ b/reference/opcache/functions/opcache-jit-blacklist.xml @@ -43,7 +43,7 @@ &return.void; - + &reftitle.examples;