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

             $name = 'tom';
         }
 
-        return $name ?? 'tom';
+        return $name ?: 'tom';
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 0594c1 - released at 2026-05-08 19:57