You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit db3fa23
Browse filesBrowse the repository at this point in the historyBrowse files
Invalidate the OPcache entries of included files before the autoload trap runs the autoloaders
AutoloadSourceLocator runs the autoloaders inside FileReadTrapStreamWrapper, which serves
an empty script for each file an autoloader includes. When the file was already included
for real, OPcache has compiled the real file. With OPcache active, the trapped include
runs that script, and the process dies with "Cannot redeclare". Two ways to get there:
- Composer's "files" autoload loads a file in a PSR-4 directory, and PHPStan asks for a
class with the name of its function.
- A bootstrap autoloader includes a file for real that does not declare the class.
OPcache is active in the --debug main process and in spawned workers, because the
process restart switches it on. Forked workers switch it off, so a default run on Linux
or macOS does not crash.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 commit comments