@@ 12-21 (lines=10) @@ | ||
9 | * |
|
10 | * @return mixed |
|
11 | */ |
|
12 | function append(/* ...$args */) |
|
13 | { |
|
14 | $args = func_get_args(); |
|
15 | ||
16 | $append = function ($x, array $xs) { |
|
17 | return array_merge($xs, [$x]); |
|
18 | }; |
|
19 | ||
20 | return call_user_func_array(partial($append), $args); |
|
21 | } |
|
22 |
@@ 12-21 (lines=10) @@ | ||
9 | * |
|
10 | * @return mixed |
|
11 | */ |
|
12 | function prop(/* ...$args */) |
|
13 | { |
|
14 | $args = func_get_args(); |
|
15 | ||
16 | $prop = function ($x, array $xs) { |
|
17 | return get($xs, $x, false); |
|
18 | }; |
|
19 | ||
20 | return call_user_func_array(partial($prop), $args); |
|
21 | } |
|
22 |