Bug report
PHPStan correctly recognizes that an array element is a string with this code:
\is_string($arguments['format']) ? $arguments['format'] : 'Y-m-d';
When I add a null coalesce operator to avoid invalid array accesses, this does not work anymore:
\is_string($arguments['format'] ?? null) ? $arguments['format'] : 'Y-m-d';
Code snippet that reproduces the problem
https://phpstan.org/r/0ee835f9-8142-4b60-9ce1-8a8006c96a3c
Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
❤️