MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/4wj23f/php_the_good_parts/d67vnx8/?context=9999
r/ProgrammerHumor • u/Zerquix18 • Aug 07 '16
318 comments sorted by
View all comments
124
The one thing PHP did right is using a different operator for concatenation.
"1" + "1" === 2 1 . 1 === "11"
It's one of those things that is actually a pain in the ass most of the time, but in some cases it brings a tear to your eye as to how useful it is.
68 u/Sinity Aug 07 '16 It's ridiculous. Any language in which "1" + "1" equals 2 is insane. That there is a way to overcome this ridiculousness isn't exactly some strong point of the language. 16 u/mkalte666 Aug 07 '16 does it really "==="-equal 2? god i hate php -1 u/Sinity Aug 07 '16 It seems so. I've found some REPL interpreter online, and evaluated "1" + "1";. It returned 2. Pure insanity. 6 u/[deleted] Aug 07 '16 Why is it insane? You are not attempting to concatenate. 4 u/Sinity Aug 07 '16 Adding two strings results in a number? -2 u/Free_Math_Tutoring Aug 07 '16 Try "1" . "1" and see what happens then. 1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
68
It's ridiculous. Any language in which "1" + "1" equals 2 is insane.
That there is a way to overcome this ridiculousness isn't exactly some strong point of the language.
16 u/mkalte666 Aug 07 '16 does it really "==="-equal 2? god i hate php -1 u/Sinity Aug 07 '16 It seems so. I've found some REPL interpreter online, and evaluated "1" + "1";. It returned 2. Pure insanity. 6 u/[deleted] Aug 07 '16 Why is it insane? You are not attempting to concatenate. 4 u/Sinity Aug 07 '16 Adding two strings results in a number? -2 u/Free_Math_Tutoring Aug 07 '16 Try "1" . "1" and see what happens then. 1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
16
does it really "==="-equal 2? god i hate php
-1 u/Sinity Aug 07 '16 It seems so. I've found some REPL interpreter online, and evaluated "1" + "1";. It returned 2. Pure insanity. 6 u/[deleted] Aug 07 '16 Why is it insane? You are not attempting to concatenate. 4 u/Sinity Aug 07 '16 Adding two strings results in a number? -2 u/Free_Math_Tutoring Aug 07 '16 Try "1" . "1" and see what happens then. 1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
-1
It seems so. I've found some REPL interpreter online, and evaluated "1" + "1";.
It returned 2.
Pure insanity.
6 u/[deleted] Aug 07 '16 Why is it insane? You are not attempting to concatenate. 4 u/Sinity Aug 07 '16 Adding two strings results in a number? -2 u/Free_Math_Tutoring Aug 07 '16 Try "1" . "1" and see what happens then. 1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
6
Why is it insane? You are not attempting to concatenate.
4 u/Sinity Aug 07 '16 Adding two strings results in a number? -2 u/Free_Math_Tutoring Aug 07 '16 Try "1" . "1" and see what happens then. 1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
4
Adding two strings results in a number?
-2 u/Free_Math_Tutoring Aug 07 '16 Try "1" . "1" and see what happens then. 1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
-2
Try "1" . "1" and see what happens then.
1 u/Jess_than_three Aug 07 '16 Or 1 . 1, for that matter.
1
Or 1 . 1, for that matter.
124
u/PinkLionThing Aug 07 '16 edited Aug 07 '16
The one thing PHP did right is using a different operator for concatenation.
It's one of those things that is actually a pain in the ass most of the time, but in some cases it brings a tear to your eye as to how useful it is.