On Monday, 19 of August 2024 г. at 20:11, Derick Rethans <der...@php.net> wrote:
> Hi! > > Arnaud, Larry, and I have been working on an article describing the > state of generics and collections, and related "experiments". > > You can find this article on the PHP Foundation's Blog: > > https://thephp.foundation/blog/2024/08/19/state-of-generics-and-collections/ > > cheers, > Derick > Hi! Thank you very much for the article. In the "Fully Erased Type Declarations" section you mention that "It's unclear what impact erased types would have on reflection, or libraries that depend on reflection." I wanted to share a thought that if code is analyzed with external tools like Psalm and PHPStan, it might make sense for reflection to be handled by external tools as well. For example, BetterReflection <https://github.com/Roave/BetterReflection> offers native reflection functionality statically and is already used by PHPStan and Rector. Additionally, I maintain a project called Typhoon Reflection <https://github.com/typhoon-php/typhoon/blob/0.4.x/docs/reflection.md> that supports phpDoc types and is capable of resolving generics and type aliases. If PHP moves toward a “fully erased type system,” it’s possible that in the future, we could see tools that both analyze code, and provide reflection. -- Best regards, Valentin