r/PHP • • Dec 29 '24

What is PHP lacking in comparison to Nodejs / Golang / Java?

[deleted] — view deleted post

85 Upvotes

213 comments sorted by

View all comments

Show parent comment

-2

u/Ejdems666 Dec 29 '24

It does have a typed array or am I missing something? Generics would be nice.

8

u/DT-Sodium Dec 29 '24

It does not. You can get the IDE to recognize it by using type annotations but it's a wooden leg. I hate having useless documentation, all the informations about what a function takes and return should be in the function declaration, not in comments.

1

u/Ejdems666 Dec 29 '24

Yeah I feel the same way about functions. Haven't coded for 3 weeks so I forgot about the typed arrays.

0

u/[deleted] Dec 29 '24

[deleted] — view deleted comment

4

u/DT-Sodium Dec 29 '24

It doesn't work for arrays. The only typing it takes is "array", not "Array<Something>" like in any civilized language.