Skip to content

Commit 568bde0

Browse files
author
nix
committed
Partial: fixed usage of named arguments
1 parent 5b0ec64 commit 568bde0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Partial.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ public static function partial(callable $callable, mixed ...$args): callable
3333
else
3434
$final_args[] = $arg;
3535
}
36-
foreach ($placeholder_args as $arg)
37-
$final_args[] = $arg;
36+
foreach ($placeholder_args as $key => $arg) {
37+
if (is_string($key))
38+
$final_args[$key] = $arg;
39+
else
40+
$final_args[] = $arg;
41+
}
3842
return $callable(...$final_args);
3943
};
4044
}

0 commit comments

Comments
 (0)