Run Rector on your code to see what it can do for you:

 <?php
 $a = 1;
 $b = [1];
 $c = [];
 
-if (in_array($a, $b)) {
-	
-} elseif (in_array($a, $c)) {
-	echo "elseif";
+if (!in_array($a, $b) && in_array($a, $c)) {
+    echo "elseif";
 } else {
 	echo "else";
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 323e82 - released at 2026-09-06 08:08