From e2b4c8d3c9cc5d2b1b152f99b2a8b8904948ae35 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 27 Nov 2018 11:58:55 +0100 Subject: [PATCH] [Debug] workaround opcache bug mutating "$this" !?! --- phpunit | 2 +- src/Symfony/Component/Debug/DebugClassLoader.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpunit b/phpunit index f4b80ed064..9975195309 100755 --- a/phpunit +++ b/phpunit @@ -1,7 +1,7 @@ #!/usr/bin/env php isFinder && !isset($this->loaded[$class])) { $this->loaded[$class] = true; - if ($file = $this->classLoader[0]->findFile($class) ?: false) { - $wasCached = \function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file); - + if (!$file = $this->classLoader[0]->findFile($class) ?: false) { + // no-op + } elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) { require $file; - if ($wasCached) { - return; - } + return; + } else { + require $file; } } else { \call_user_func($this->classLoader, $class);