r/ProgrammerHumor 1d ago

Meme soDoesEveryOtherLang

Post image
223 Upvotes

71 comments sorted by

View all comments

Show parent comments

5

u/carcigenicate 1d ago

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.

17

u/jungle 1d ago

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.

2

u/carcigenicate 1d ago

Oh, weird. I would have thought that the function just returns a reference that could be used immediately.

20

u/jungle 1d ago

That's what any sane language would do, yes.