diff --git a/ChangeLog-8.5.md b/ChangeLog-8.5.md index ca6f31dc41c..9b9bdc9cf73 100644 --- a/ChangeLog-8.5.md +++ b/ChangeLog-8.5.md @@ -8,6 +8,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil * [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly * [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` +* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1 ## [8.5.13] - 2020-12-01 diff --git a/src/Util/Configuration.php b/src/Util/Configuration.php index 151c503fbb9..dfc4e241fe2 100644 --- a/src/Util/Configuration.php +++ b/src/Util/Configuration.php @@ -434,26 +434,16 @@ public function handlePHPConfiguration(): void } } - foreach (['var', 'post', 'get', 'cookie', 'server', 'files', 'request'] as $array) { - /* - * @see https://github.com/sebastianbergmann/phpunit/issues/277 - */ - switch ($array) { - case 'var': - $target = &$GLOBALS; - - break; - - case 'server': - $target = &$_SERVER; - - break; + foreach ($configuration['var'] as $name => $data) { + $GLOBALS[$name] = $data['value']; + } - default: - $target = &$GLOBALS['_' . strtoupper($array)]; + foreach ($configuration['server'] as $name => $data) { + $_SERVER[$name] = $data['value']; + } - break; - } + foreach (['post', 'get', 'cookie', 'files', 'request'] as $array) { + $target = &$GLOBALS['_' . strtoupper($array)]; foreach ($configuration[$array] as $name => $data) { $target[$name] = $data['value'];