Skip to content

Commit d5a1f2a

Browse files
committed
Create bug-12087c.php
1 parent 2ce278c commit d5a1f2a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php // lint >= 8.1
2+
3+
namespace Bug12087c;
4+
5+
enum Button: int
6+
{
7+
case On = 1;
8+
9+
case Off = 0;
10+
}
11+
12+
function doFoo() {
13+
$value = 10;
14+
15+
is_null($foo = $value = Button::tryFrom($value));
16+
}
17+
18+
function doFoo2() {
19+
$value = 10;
20+
21+
is_null($foo ??= Button::tryFrom($value));
22+
}

0 commit comments

Comments
 (0)