Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress the each() function's deprecation error
- Loading branch information
1 parent
ee54bd6
commit 20c70e0
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ public static function getopt(array $args, $short_options, $long_options = null) | |
|
||
reset($args); | ||
|
||
while (list($i, $arg) = each($args)) { | ||
while (list($i, $arg) = @each($args)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sebastianbergmann
Author
Owner
|
||
if ($arg == '') { | ||
continue; | ||
} | ||
|
@@ -91,7 +91,7 @@ protected static function parseShortOption($arg, $short_options, &$opts, &$args) | |
if ($i + 1 < $argLen) { | ||
$opts[] = [$opt, substr($arg, $i + 1)]; | ||
break; | ||
} elseif (list(, $opt_arg) = each($args)) { | ||
} elseif (list(, $opt_arg) = @each($args)) { | ||
} else { | ||
throw new PHPUnit_Framework_Exception( | ||
"option requires an argument -- $opt" | ||
|
@@ -136,7 +136,7 @@ protected static function parseLongOption($arg, $long_options, &$opts, &$args) | |
|
||
if (substr($long_opt, -1) == '=') { | ||
if (substr($long_opt, -2) != '==') { | ||
if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) { | ||
if (!strlen($opt_arg) && !(list(, $opt_arg) = @each($args))) { | ||
throw new PHPUnit_Framework_Exception( | ||
"option --$opt requires an argument" | ||
); | ||
|
Just foreach instead?