— Yeah, PHP is both objectively and semantically harder to use than most other languages. It might have uses in text processing (I know a Googler who uses it to make books) or any number of "best-fit" use cases, but that doesn't detract from the ever present problems it has
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.
— 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
— 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.
— 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.
— Plus you can do type safety, strict/static types easier; a construct that when tried in PHP is annoying at best, catastrophic at worst.
— Duck typing isn't a problem, inconsistency is objectively bad always.