"(PHPUnit) PHP fatal error: Uncaught error: Call to undefined function each()"
<p>First, I got a warning and a fatal error. Warning: </p>
<pre class="brush:php;toolbar:false;">Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?</pre>
<p>Then I replaced continue with break and the warning disappeared. But even after replacing, the fatal error still occurs. Fatal error: </p>
<pre class="brush:php;toolbar:false;">PHP Fatal error: Undefined function each() was called at line 80 of D:xamppphppearPHPUnitUtilGetopt.php
Stack trace:
#0 D:xamppphppearPHPUnitTextUICommand.php(242): PHPUnit_Util_Getopt::getopt(Array, 'd:c:hv', Array)
#1 D:xamppphppearPHPUnitTextUICommand.php(138): PHPUnit_TextUI_Command->handleArguments(Array)
#2 D:xamppphppearPHPUnitTextUICommand.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 D:xamppphpphpunit(46): PHPUnit_TextUI_Command::main()
#4 {main}
Throws at line 80 of D:xamppphppearPHPUnitUtilGetopt.php
Fatal error: Undefined function each() called in D:xamppphppearPHPUnitUtilGetopt.php on line 80
Stack trace:
#0 D:xamppphppearPHPUnitTextUICommand.php(242): PHPUnit_Util_Getopt::getopt(Array, 'd:c:hv', Array)
#1 D:xamppphppearPHPUnitTextUICommand.php(138): PHPUnit_TextUI_Command->handleArguments(Array)
#2 D:xamppphppearPHPUnitTextUICommand.php(129): PHPUnit_TextUI_Command->run(Array, true)
#3 D:xamppphpphpunit(46): PHPUnit_TextUI_Command::main()</pre>
<p>Lines 77-83 of Getopt.php</p>
<pre class="brush:php;toolbar:false;">reset($args);
array_map('trim', $args);
while (list($i, $arg) = each($args)) {
if ($arg == '') {
continue;
}</pre>
<p>I'm using PHP 8.0.1 and PHPUnit 9 (at least I think so since I can't check with the command and I downloaded it after February 7th) </p>