Generics have userland support. PHP Core has better things to spend developer time on than generics (which are already a thing implemented in userland).
You may do so, but static analysis and code quality tools are far more widespread than in Java.
From what I can see Java is lacking in this regard. There is no linter with autofix capabilities and CheckStyle is quite lackluster. In PHP you drop a 3 line XML in the root and you have checks for PSRs and autofixes for them. Much better experience.
You also have to consider that there aren't that many PHP Core devs and they really do have much better things to spend their time on than an already solved problem. Bolting generics onto the language is no easy feat.
Aside from the fact that /u/dpash has answered you, let me remind you that Java is a (moderately) strongly-typed static language. PHP is neither, and so, ipso facto, needs a lot more analysis tools not to mention testing.
0
u/helloiamsomeone Apr 20 '21
Generics have userland support. PHP Core has better things to spend developer time on than generics (which are already a thing implemented in userland).