MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/3v4l98/php_7_released/cxl04dx/?context=3
r/programming • u/fnkrx • Dec 02 '15
729 comments sorted by
View all comments
Show parent comments
28
Mostly.
"34" != "34 " and " 34" != "34 ".
"34" != "34 "
" 34" != "34 "
But "34" == " 34".
"34" == " 34"
Wat.
3 u/alexanderpas Dec 02 '15 integer comparison vs. string comparison.http://php.net/manual/en/language.types.string.php#language.types.string.conversion 2 u/greyfade Dec 02 '15 This is one of PHP's more annoying issues. When comparing two values that are strings, they should not be converted to ints just because they can be. 2 u/alexanderpas Dec 02 '15 Then you should just use the === operator.== is nice when you want to compare data from $_GET etc. → More replies (0)
3
integer comparison vs. string comparison.
http://php.net/manual/en/language.types.string.php#language.types.string.conversion
2 u/greyfade Dec 02 '15 This is one of PHP's more annoying issues. When comparing two values that are strings, they should not be converted to ints just because they can be. 2 u/alexanderpas Dec 02 '15 Then you should just use the === operator.== is nice when you want to compare data from $_GET etc. → More replies (0)
2
This is one of PHP's more annoying issues. When comparing two values that are strings, they should not be converted to ints just because they can be.
2 u/alexanderpas Dec 02 '15 Then you should just use the === operator.== is nice when you want to compare data from $_GET etc. → More replies (0)
Then you should just use the === operator.
===
== is nice when you want to compare data from $_GET etc.
==
→ More replies (0)
28
u/NeuroXc Dec 02 '15
Mostly.
"34" != "34 "and" 34" != "34 ".But
"34" == " 34".Wat.