Skip to content

Fix incorrect claim that opcache_invalidate() skips the file cache - #5723

Merged
jordikroon merged 1 commit into
php:masterfrom
GabrielCordeiroBarrosoTeles:fix/opcache-invalidate-file-cache-claim
Jul 31, 2026
Merged

Fix incorrect claim that opcache_invalidate() skips the file cache#5723
jordikroon merged 1 commit into
php:masterfrom
GabrielCordeiroBarrosoTeles:fix/opcache-invalidate-file-cache-claim

Conversation

@GabrielCordeiroBarrosoTeles

Copy link
Copy Markdown
Contributor

Summary

  • opcache_invalidate()'s description states it "only invalidates in-memory cache and not file cache", which is incorrect.
  • Since file cache support was added in 2015, zend_accel_invalidate() in ext/opcache/ZendAccelerator.c calls zend_file_cache_invalidate() whenever opcache.file_cache is enabled, which deletes the corresponding compiled file from the file cache (zend_file_cache_unlink() in ext/opcache/zend_file_cache.c).
  • Updated the description to describe the actual behavior instead.

Closes #5696

Test plan

  • Validated the XML with configure.php (no local build environment set up here, would appreciate a CI check)

opcache_invalidate() has called zend_file_cache_invalidate() whenever
opcache.file_cache is enabled since file cache support was added in
2015 (ZendAccelerator.c), which deletes the corresponding file cache
entry. Update the description to reflect this instead of stating that
only the in-memory cache is invalidated.

Closes php#5696
@jordikroon
jordikroon merged commit 82cdc19 into php:master Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

function.opcache-invalidate: Is "This function only invalidates in-memory cache and not file cache." still correct (or was it ever)?

2 participants