8000 [Debug] workaround opcache bug mutating "$this" !?! · symfony/symfony@e2b4c8d · GitHub
[go: up one dir, main page]

Skip to content

Commit e2b4c8d

Browse files
[Debug] workaround opcache bug mutating "$this" !?!
1 parent acce087 commit e2b4c8d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/66ffffcd8a6bb23aec847c8bdfb918610399499a
4+
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/2155067dfc73e0e77dbc26f236af17e4df552de5
55

66
if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
77
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ public function loadClass($class)
138138
try {
139139
if ($this->isFinder && !isset($this->loaded[$class])) {
140140
$this->loaded[$class] = true;
141-
if ($file = $this->classLoader[0]->findFile($class) ?: false) {
142-
$wasCached = \function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file);
143-
141+
if (!$file = $this->classLoader[0]->findFile($class) ?: false) {
142+
// no-op
143+
} elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) {
144144
require $file;
145145

146-
if ($wasCached) {
147-
return;
148-
}
146+
return;
147+
} else {
148+
require $file;
149149
}
150150
} else {
151151
\call_user_func($this->classLoader, $class);

0 commit comments

Comments
 (0)
0