News for hackers. Stuff that matters.
Re:PHP compile time generics: yay or nay? by skissane on Sunday August 10, 2025 @07:22PM (#44859312)
> Erased generics the type information is not available at run time. That's the way Java does it and it kinda sucks.

To be more precise: in Java, generics on class/method/field declarations are available at runtime via reflection. The issue is that they aren’t available for instances. So a java.util.ArrayList<java.lang.String> instance is indistinguishable at runtime from a java.util.ArrayList<java.lang.Object> instance

There are no comments on this comment yet.