Skip to content

Commit 2beea97

Browse files
committed
Ensure higher order functions stil work.
1 parent 59873a7 commit 2beea97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Zend/tests/pipe_operator/mixed_callable_call.phpt

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ function _double(int $x): int {
3131
return $x * 2;
3232
}
3333

34+
function multiplier(int $x): \Closure
35+
{
36+
return fn($y) => $x * $y;
37+
}
38+
3439
$test = new _Test();
3540

3641
$add3 = fn($x) => _add($x, 3);
@@ -41,9 +46,10 @@ $res1 = 2
4146
|> $add3
4247
|> fn($x) => _area($x, 2)
4348
|> _double(...)
49+
|> multiplier(3)
4450
;
4551

4652
var_dump($res1);
4753
?>
4854
--EXPECT--
49-
int(40)
55+
int(120)

0 commit comments

Comments
 (0)