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
-------

e2b4c8d3c9 [Debug] workaround opcache bug mutating "$this" !?!
This commit is contained in:
Nicolas Grekas 2018-11-27 13:45:32 +01:00
commit d129e197fe
2 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/66ffffcd8a6bb23aec847c8bdfb918610399499a
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/2155067dfc73e0e77dbc26f236af17e4df552de5
if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";

View File

@ -138,14 +138,14 @@ class DebugClassLoader
try {
if ($this->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);