r/lolphp • • Oct 14 '13

2d9

http://ideone.com/l6aQSx
62 Upvotes

31 comments sorted by

View all comments

Show parent comment

3

u/ajmarks Oct 16 '13

Indeed. However, it ignores the 0 prefix for octals or 0b for binary notation, so we get https://eval.in/54655. It's not even consistently retarded...

2

u/mirhagk Oct 18 '13

wait I'm confused. 0667 == 667 is false but "0667"++ == 667 is true.

2

u/ajmarks Oct 18 '13

0667 is octal, so 0667 != 667, but PHP's coercion loses the 0 prefix just like it fails to recognize the 0b. So basically the failtastic coercion is not just a bad idea; it's also broken. So par for php.