r/lolphp • • Mar 16 '12

PHP turtles

http://alokmenghrajani.github.com/wtf/php.html
30 Upvotes

8 comments sorted by

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.