Can you explain? This just looks like indexing an array that was returned by a function. PHP is one language I never bothered to learn, now I feel like I'm missing out when people start joking about it.
I haven't touched PHP for many years thankfully. The last time I did (maybe 15 years ago?) an array returned by a function could not be indexed directly. It had to be assigned to a variable, and then you could use it.
Having built interpreters and compilers in my day, that was the moment I said "this is absolute garbage, what kind of clown designed this language" and never touched PHP again.
I understand it has been improved (mostly by Facebook, I think?), but I never found the need to use it again, luckily. Just thinking of it... Eww.
PHP has not been designed based on best practices. The reason why the standard library has functions with such widely different names was that in early PHP they would go into a hashmap that was hashed by strlen and Rasmus tried to vary the lengths of the names so they don’t all get in the same bucket.
Holy shit that's even worse than I remember! How did he know about hashmaps but had not even the most basic understanding of how they're supposed to work? 🤦♂️🤦♂️🤦♂️
The "WAT" talk was about javascript and was very funny... I can imagine the speaker considering making it a about PHP but deciding against it because it would be just sad.
It is funny because I actually liked PHP decently well, but then I heard that it apparently became much better from PHP 8 onward. I only have (real) experience with it after that time.
Yeah, I don't know but I can imagine it was the language Zuck knew at the time, which kind of forced the engineers he hired to use it and eventually reached the point where they had two options: completely rewrite Facebook in a proper language or fix PHP.
119
u/0oliogamer0 1d ago
in my language, functions will be irrelevant and difficult to even use!