3 ms·
Modern PHP shops don't really do dynamic PHP anymore. Ever since it got types and runtime type validation. Refactoring is also proven to be very easy as a resul
by askonomm 1y ago
Modern PHP shops don't really do dynamic PHP anymore. Ever since it got types and runtime type validation. Refactoring is also proven to be very easy as a result, and especially with something like Rector (https://github.com/rectorphp/rector https://github.com/rectorphp/rector).
- nh2 1y ago> types and runtime type validation This is what "dynamic typing" means. In other languages, you know that the types are right /before/ you run the code.
- askonomm 1y agoYes, you also know this in modern PHP. https://www.php.net/manual/en/language.types.declarations.php https://www.php.net/manual/en/language.types.declarations.ph.... You add type declarations just like any other statically typed language, and you can get your static analysis by your editor out of the box. But in addition to that, you ALSO get runtime type validation, something that most languages won't give you, and something that to me at least is amazing since code correctness is one thing, but data correctness is even more important in my opinion, and runtime type validation gives you data correctness, built in, no need to mess around with external libraries.