ZF-5948: Neverending loop in ->parse()


->setArguments() require an array as the only parameter, but setting it to something else i.e. a string or number will cause ->parse() to jump into a neverending loop at line 697: Warning: array_shift(): The argument should be an array in \includes\ZendFramework-1.7.4\library\Zend\Console\Getopt.php on line 697

An error message both in ->setArguments() and ->parse() would be more apropriate :)


Attached patch to throw Zend_Console_Getopt_Exception when not given an array as parameter. Another solution would be to transform the non-array value into an array and work with that. However, current documentation would suggest the Exception should be the expected behaviour.

Resolved in r19765