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: 6200ba - released at 2026-04-11 10:23