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

 <?php
 
-function foo(int $bar = null){}
+function foo(?int $bar = null){}
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 13f7ab - released at 2026-01-07 13:19