diff --git a/lib/Docopt.php b/lib/Docopt.php index 46c5229..98e81ff 100644 --- a/lib/Docopt.php +++ b/lib/Docopt.php @@ -152,12 +152,12 @@ class Docopt { # groups.append(child.children + children) if ($child instanceof Either) { foreach ($child->children as $c) { - $groups[] = [$c, ...$children]; + $groups[] = array_merge([$c], $children); } } elseif ($child instanceof OneOrMore) { - $groups[] = [...$child->children, ...$child->children, ...$children]; + $groups[] = array_merge($child->children, $child->children, $children); } else { - $groups[] = [...$child->children, ...$children]; + $groups[] = array_merge($child->children, $children); } } # else: