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

 class Banana {
 
     public function example(mixed $value): bool {
-        if (is_array($value) && empty(array_filter($value))) {
+        if (array_filter($value) === []) {
             return true;
         }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 5bbc5e - released at 2025-08-26 00:54