From 0aeb87c21cd730a5bf7796724653671a5df89b6f Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 1 Dec 2023 17:57:50 +0100 Subject: [PATCH] Simplify --- tests/Loop/ForeachTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Loop/ForeachTest.php b/tests/Loop/ForeachTest.php index fbbb6e445..d7b56e5fa 100644 --- a/tests/Loop/ForeachTest.php +++ b/tests/Loop/ForeachTest.php @@ -1027,9 +1027,7 @@ class ForeachTest extends TestCase $arr = []; foreach ([1, 2, 3] as $i) { - if (!isset($arr[$i]["a"])) { - $arr[$i]["a"] = 0; - } + $arr[$i]["a"] ??= 0; $arr[$i]["a"] += 5; }