Skip to content

Commit ce5f316

Browse files
rrazorondrejmirtes
authored andcommitted
Disable OpCache for PHP < 7.4.x, #4881
1 parent 18340a3 commit ce5f316

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/phpstan

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ use Symfony\Component\Console\Helper\ProgressBar;
1111
(function () {
1212
error_reporting(E_ALL);
1313
ini_set('display_errors', 'stderr');
14+
if (version_compare(PHP_VERSION, '7.4.0', '<')) {
15+
// PHP earlier than 7.4.x with OpCache triggers a bug when we intercept
16+
// custom autoloaders' reads to discover file paths. See PHPStan #4881.
17+
ini_set('opcache.enable', 'Off');
18+
}
1419
gc_disable(); // performance boost
1520

1621
define('__PHPSTAN_RUNNING__', true);

0 commit comments

Comments
 (0)