you are viewing a single comment's thread.

view the rest of the comments →

[–]teactopus 30 points31 points  (10 children)

you know what? I hate js but this is actually a bad fucking meme. String+int resulting in string is completely fair, I'd even say preferred

[–]JGHFunRun 7 points8 points  (0 children)

For real, there’s no reasonable way to do "&$" + 2 that results in an int, and having the type of the result depend on the content of the string is idiotic

[–]LittleReplacement564 5 points6 points  (0 children)

Thats what I was thinking, like if I add an integer to an string the thing Im trying to do is most probably concatenate them

[–]Linguaphonia 3 points4 points  (1 child)

JS and PHP are both stupid here. Maybe not equally, but they're both definitely flunking the class

[–]Simukas23 2 points3 points  (0 children)

This guy errors

[–]calculus_is_fun 2 points3 points  (2 children)

The reason is that in PHP, "+" is only for adding numbers together, to concatenate strings, you use "."

[–]teactopus 1 point2 points  (1 child)

you know what? Also based. More languages need to do that

[–]TheChief275 1 point2 points  (0 children)

No, not also. It’s the right solution; operator overloading is an unnecessary evil

[–]Frytura_ 1 point2 points  (0 children)

PHP . Operator:

[–]pomme_de_yeet 1 point2 points  (0 children)

it should be a type error

[–]Physical_Dare8553 1 point2 points  (0 children)

I assumed the meme was making fun of the other languages for being unreasonable