1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
diff --git a/src/Util/Configuration.php b/src/Util/Configuration.php
index b2f7a7bd0c6..1a1a444d378 100644
--- a/src/Util/Configuration.php
+++ b/src/Util/Configuration.php
@@ -514,22 +514,17 @@ public function handlePHPConfiguration()
foreach (array('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;
-
- default:
- $target = &$GLOBALS['_' . strtoupper($array)];
- break;
- }
-
foreach ($configuration[$array] as $name => $value) {
- $target[$name] = $value;
+ switch ($array) {
+ case 'var':
+ $GLOBALS[$name] = $value;
+ break;
+ case 'server':
+ $_SERVER[$name] = $value;
+ break;
+ default:
+ $GLOBALS['_' . strtoupper($array)][$name] = $value;
+ }
}
}
diff --git a/src/Util/Getopt.php b/src/Util/Getopt.php
index 370e97d73f8..5bd8553970b 100644
--- a/src/Util/Getopt.php
+++ b/src/Util/Getopt.php
@@ -144,7 +144,7 @@ protected static function parseLongOption($arg, $long_options, &$opts, &$args)
if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
- if (!strlen($opt_arg)) {
+ if (null === $opt_arg || strlen($opt_arg) < 1) {
$opt_arg = current($args);
next($args);
if (!($opt_arg)) {
|