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

Equal to identical #1511

Merged
merged 3 commits into from Jul 1, 2016
Merged

Equal to identical #1511

merged 3 commits into from Jul 1, 2016

Conversation

cheprasov
Copy link
Contributor

In PHP any string, that does not started from number is equal (==) 0.
Example:

var_dump(0 == '+'); // true
var_dump(0 == '*'); // true
var_dump(0 == '&'); // true
var_dump(0 == 'foo'); // true

var_dump(0 != '&'); // false

To avoid this behavior is better to use identical operator (===)
Also, === is faster than ==

@Tobion
Copy link
Member

Tobion commented Jul 1, 2016

👍

@mtdowling mtdowling merged commit 90a08e8 into guzzle:master Jul 1, 2016
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.

None yet

3 participants