PHP is a pretty insane language though. I've started using Deno / Typescript for my scripting purposes and it is just a way way better experience than anything else I've used (and I have been searching for ages).
Pretty much every other option falls down in some way:
* Dart, Rust, Node etc. don't let you use just a single file like Python does.
* Python is very slow and it's type annotation system is better than nothing but is still the worst I have used.
* Everything except maybe Go requires you to list dependencies in a separate file, which rules out single-file scripts.
Deno is easily worth the installation effort, especially since it's so easy to install. You'd be really mad to stick with PHP.
Pretty much every other option falls down in some way:
* Dart, Rust, Node etc. don't let you use just a single file like Python does.
* Python is very slow and it's type annotation system is better than nothing but is still the worst I have used.
* Everything except maybe Go requires you to list dependencies in a separate file, which rules out single-file scripts.
Deno is easily worth the installation effort, especially since it's so easy to install. You'd be really mad to stick with PHP.