Skip to content

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Jun 30, 2022

Closes phpstan/phpstan#7555

Apparently this would return that some constant string is surely not e.g. 'ab' in a falsey scope but at the same time the scope has the info that it surely is 'ab' in a truthy scope. And that seams lead to a *NEVER* type.

The blocks before this one, that deal with a related thing, do it a bit different but very similar, e.g. https://github.com/phpstan/phpstan-src/blob/1.8.0/src/Analyser/TypeSpecifier.php#L237

@herndlm herndlm marked this pull request as ready for review June 30, 2022 20:57
@ondrejmirtes ondrejmirtes merged commit cd7f82c into phpstan:1.8.x Jun 30, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@staabm
Copy link
Contributor

staabm commented Jul 1, 2022

Thx Martin!

@herndlm herndlm deleted the fix-7555 branch July 1, 2022 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive when comparing strlen($string) after testing substr($string)
3 participants