[11.x] Apc Cache - Remove long-time gone apc_* functions #51010
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
APC has been deprecated since PHP 7 with the introduction of opcache, and no longer even compiles for PHP 8.x.
Removes the usage of apc_* functions and the need to check which version of the functions to call in ApcWrapper.
This has a code maintenance benefit of clearing out code paths that are no longer relevant due to supported PHP versions.
This has a minor performance benefit as usage of Apcu cache no longer has an extra boolean check on every method call.
Note: An even better implementation would be to ditch the ApcWrapper altogether and move the simple implementation of each cache method directly into ApcStore, but that requires more creative changes to the CacheApcStoreTest as it relied on mocking the ApcWrapper to validate the implementation. Updating these tests to mocking the builtin apcu_* functions would be a chore. Or perhaps with the implementation being simply a wrapper around apcu_* calls anyway it would be safe to kill off the test entirely. But that may also be viewed as a breaking change.