Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



It 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: