From c52ee8b53723a23da9618b5dc0ca4f5bd40fff41 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Thu, 10 Feb 2022 10:09:05 -0500 Subject: [PATCH] Avoid array (but not argument) unpacking Array unpacking requires PHP 7.4; array_merge is clearer in any case --- lib/Docopt.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: