Run Rector on your code to see what it can do for you:
interface Foo {} interface Bar {} -function name(Foo&Bar $foo = null): string { +function name((Foo&Bar)|null $foo = null): string { return (string) $foo; }
Applied Rules:
Not a change you expect?
rector.php