Skip to content

Commit 56add1d

Browse files
committed
Merge branch '3.7'
2 parents 8e59e81 + 1f5bee4 commit 56add1d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

PHPUnit/Util/Configuration.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,23 @@ public function handlePHPConfiguration()
541541
}
542542

543543
foreach (array('var', 'env', 'post', 'get', 'cookie', 'server', 'files', 'request') as $array) {
544-
if ($array == 'var') {
545-
$target = &$GLOBALS;
546-
} else {
547-
$target = &$GLOBALS['_' . strtoupper($array)];
544+
// See https://github.com/sebastianbergmann/phpunit/issues/277
545+
switch ($array) {
546+
case 'var':
547+
$target = &$GLOBALS;
548+
break;
549+
550+
case 'env':
551+
$target = &$_ENV;
552+
break;
553+
554+
case 'server':
555+
$target = &$_SERVER;
556+
break;
557+
558+
default:
559+
$target = &$GLOBALS['_' . strtoupper($array)];
560+
break;
548561
}
549562

550563
foreach ($configuration[$array] as $name => $value) {

0 commit comments

Comments
 (0)