Comment by ramon156
19 hours ago
Awesome! Off-topic, can we get something like TS for PHP now? Tools like PHPStan work fine, but I'd love a typed language on top of PHP that can catch a lot of things on compile time. I want to be able to compile my symfony routes, avoiding as much as possible on runtime.
I've been thinking about this since 2022 and haven't really gotten further than "Hmm, I would like this".
I'm aware that tooling catches most stuff, but being able to shift this even more to the left (compile time) would be great.
I'm just very used to Rust, where my hand is being held
Have you considered Hack (https://hacklang.org/)? it's PHP with types from Facebook, probably the biggest contributor to the PHP ecosystem at the moment.
It does need a compiler though, unlike TS where an interpreter can just strip / ignore type annotations. But IMO, a compile step is worth it if you get type assurances in return.