Skip to content

Fixed Getopt::parse() fails to handle array argument

Thomas Flori requested to merge github/fork/ozami/fix-parse-with-array-args into master

Created by: ozami

When parse() was called with an explicit array argument, it failed to pick the script name from arguments, then the whole arguments were parsed as operands. For example, $getopt->parse(['foo.php', '-a']) results in:

  • scriptName: null
  • operands: ["foo.php", "-a"]
  • options: []

Merge request reports