r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

Show parent comments

9

u/oridb Dec 02 '15

Aren't those all the same?

28

u/NeuroXc Dec 02 '15

Mostly.

"34" != "34 " and " 34" != "34 ".

But "34" == " 34".

Wat.

3

u/alexanderpas Dec 02 '15

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.

→ More replies (2)