Skip to content

Commit ead2908

Browse files
committed
Fixup tests
1 parent f652cf0 commit ead2908

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/Loop/ForeachTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,7 @@ function foo() : void {
10271027
$arr = [];
10281028
10291029
foreach ([1, 2, 3] as $i) {
1030-
if (!isset($arr[$i]["a"])) {
1031-
$arr[$i]["a"] = 0;
1032-
}
1030+
$arr[$i]["a"] ??= 0;
10331031
10341032
$arr[$i]["a"] += 5;
10351033
}

0 commit comments

Comments
 (0)