Message from JavaScript discussions

September 2017

— If you use PHP for building big apps, you should consider C# or C++, since PHP is designed to (feebly and incorrectly) emulate the semantcs of those languages.

Message permanent page

— 

Just testing PHP and found out:
$a = "2 Apples";
$b = "3 Billion cats";
echo ($a+$b); // output => 5

How can string coerced with string become int ignoring the letter? 🤣

— Why would one do this?

— Because you concat strings with a . in php. Dont ask me why... Also i'd expect an error and not this kind of working bullshit

Message permanent page

— But thats what you get for using php

— Meh, there's worse problems than the semantics, the semantics are just the most noticable thing

— There isn't really a fleshed out language, most interactions are directly with C++ libraries, which aren't even renamed.

Message permanent page

— So what it comes down to is... You'd use the same libraries (std, stl, boost, etc...) but have a better, easier experience by using C++ directly, IMO.

Message permanent page

— Plus you can do type safety, strict/static types easier; a construct that when tried in PHP is annoying at best, catastrophic at worst.

Message permanent page

— Https://www.destroyallsoftware.com/talks/useing-youre-types-good

— Duck typing isn't a problem, inconsistency is objectively bad always.

— That is the number one reason it is considered objectively bad... If I were speaking subjectively I would say so and you'd know it's a matter of opinion, which this is not. Compared, objectively, to the very languages PHP was based off (semantically, even), PHP simply *is* far worse in terms of consistency. There is no other real metric than "is it on fire?" that would draw such a conclusion

Message permanent page