Description
Bug report
Hi @staabm,
I thought I already reported this but can't find it. In phpdoc-parser we have this piece of code and it's currently causing a false positive. Do you think that with the recent tagged unions improvements, we could fix this? The idea is that if $str[0] === 'u'
then $matches[2]
exists.
Maybe it's not a problem with the regex array shapes anymore, but rather with the $str[0] === 'u'
, not sure.
Can you look into it? Thanks.
Code snippet that reproduces the problem
https://phpstan.org/r/11eb77e5-ad9c-4eae-bc16-16755aeff9ec
Expected output
if $str[0] === 'u'
then $matches[2]
exists.
Did PHPStan help you today? Did it make you happy in any way?
No response