Beware that only existing files can be invalidated.
Instead of removing a file from opcache that you have delete, you need to call opcache_invalidate before deleting it.
(PHP 5 >= 5.5.0, PHP 7, PECL ZendOpcache >= 7.0.0)
opcache_invalidate — Invalidates a cached script
This function invalidates a particular script from the opcode cache. If
force is unset or
FALSE, the script will only be
invalidated if the modification time of the script is newer than the cached
The path to the script being invalidated.
If set to
TRUE, the script will be invalidated regardless of whether
invalidation is necessary.
TRUE if the opcode cache for
invalidated or if there was nothing to invalidate, or
FALSE if the opcode
cache is disabled.