What potential caching issues should be considered when updating PHP classes?

When updating PHP classes, one potential caching issue to consider is that the old version of the class may still be cached by opcode caches like OPcache or APC. This can lead to unexpected behavior or errors if the cached version is incompatible with the changes made to the class. To solve this issue, you can manually clear the opcode cache or restart the web server to force a recompilation of the PHP files.

// Clear OPcache
if (function_exists('opcache_reset')) {
    opcache_reset();
}

// Restart web server
// This can vary depending on the server setup, but generally involves running a command like:
// sudo service apache2 restart