-
Notifications
You must be signed in to change notification settings - Fork 551
Comparison with strtolower() etc. leads lower/upper-case-string #4857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.1.x
Are you sure you want to change the base?
Conversation
|
This pull request has been marked as ready for review. |
|
@VincentLanglet would love your feedback, as you implemented lowser/upper case handling IIRC |
| { | ||
| if (strtolower($s) === 'hallo') { | ||
| assertType('non-falsy-string', $s); | ||
| assertType('lowercase-string&non-falsy-string', $s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, it's not because strtolower($s) is a lowerstring than $s is a lowercase string.
It's only the case if $s === strtolower($something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. I mixed up the operands 🫣
closes phpstan/phpstan#14047