7 ms·
Php supports (somewhat) strictly defined types. You can defined what types/interfaces methods needs to return, what types/interfaces variables must have, what
by perttir 6y ago
Php supports (somewhat) strictly defined types.
You can defined what types/interfaces methods needs to return, what types/interfaces variables must have, what types/interfaces the method arguments needs to have.
It also supports class inheritance, abstract classes, interface classes, class traits, etc.
- solraph 6y agoIt does, and using PHP in strict mode, in combination with tools like phpstan is what led me to looking for a language that is even better in that regard. If PHP hadn't made advances in it's type system with the 7.x series, I probably would not have stuck with it this long. However, while PHP the language supports strict typing, it does it at run time (inherently a limitation of scripted languages, I know), rather than compile time.