Skip to content

Commit a24dbeb

Browse files
committed
Add test
1 parent aca1f54 commit a24dbeb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Short closures: RFC example
3+
--FILE--
4+
<?php
5+
6+
$a = 1;
7+
$b = 2;
8+
$c = 3;
9+
$ret = match ($a) {
10+
1, 3, 5 => (fn() {
11+
$val = $a * $b;
12+
return $val * $c;
13+
})(),
14+
2, 4, 6 => (fn() {
15+
$val = $a + $b;
16+
return $val + $c;
17+
})(),
18+
};
19+
var_dump($ret);
20+
--EXPECT--
21+
int(6)

0 commit comments

Comments
 (0)