Skip to content
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

[5.7] Always prefer stricter comparison for non-empty strings. #26139

Merged
merged 1 commit into from
Oct 17, 2018
Merged

[5.7] Always prefer stricter comparison for non-empty strings. #26139

merged 1 commit into from
Oct 17, 2018

Conversation

lucasmichot
Copy link
Contributor

Always prefer stricter comparison for non-empty strings.

@browner12
Copy link
Contributor

@garygreen I'm a little confused, since it seems you're suggesting this would make case-insensitive comparisons case-sensitive. However, when running

var_dump('string' == 'String');
var_dump('string' === 'String');

both evaluate to false.

https://3v4l.org/5eJDb

@lucasmichot
Copy link
Contributor Author

Thanks for the clarification @browner12
@garygreen, strict comparison is about the type
So string in this case

They should always be used by default, UNLESS we have a very good reason not to.

@garygreen
Copy link
Contributor

Yeah my bad didn't fully understand changes in PR. Seems reasonable to me

@taylorotwell taylorotwell merged commit 67b9ef9 into laravel:5.7 Oct 17, 2018
@lucasmichot lucasmichot deleted the feature/always-prefer-stricter-non-empty-string-comparison branch October 17, 2018 17:51
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.

4 participants