8000 bug #29349 [Debug] workaround opcache bug mutating "$this" !?! (nicol… · symfony/symfony@d129e19 · GitHub
[go: up one dir, main page]

Skip to content

Commit d129e19

Browse files
bug #29349 [Debug] workaround opcache bug mutating "$this" !?! (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Debug] workaround opcache bug mutating "$this" !?! | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29347 | License | MIT | Doc PR | - This makes absolutely no sense but works around an OPcache bug. Commits ------- e2b4c8d [Debug] workaround opcache bug mutating "$this" !?!
2 parents 53f28bf + e2b4c8d commit d129e19

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