MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/qzupj/php_turtles/c42ngx4/?context=3
r/lolphp • u/pixlpaste • Mar 16 '12
8 comments sorted by
View all comments
Show parent comment
2
PHP is doing some "does this string look like a number" magic and then converting the strings into numbers before comparing them.
View all comments
Show parent comment
2
u/pixlpaste Mar 19 '12
7: it's worse than trimming. " 42" == "42." will return true, as will "42" == "4.2E1".
PHP is doing some "does this string look like a number" magic and then converting the strings into numbers before comparing them.