3 ms·
PHP doesn't compile so all errors become runtime errors.
by wolco 6y ago
PHP doesn't compile so all errors become runtime errors.
- fennecfoxen 6y agoIt is nice that you are trying to inform me but I am already aware of the information that you bring and your decision to bring it makes it seem to me as if you are uninformed. It is possible to conduct static analysis of a source code file that is not "compilation" in the sense that you would otherwise see with Java or C. Python's not really any different than PHP in this regard.
- stunt 6y agoYeah but should use static analysis tools in your CI/CD and development workflow when using an interpreted language. That's a must have. So better typing can definitely help to catch those before pushing and running your code.
- nawarian 6y agoSmall correction: php IS compiled, just not the way we're used with the term. See https://thephp.website/en/issue/php-8-jit/ https://thephp.website/en/issue/php-8-jit/ for more information. The answers below show a good solution for this issue: use static analysis tools in build time and potentially even as a pre-commit hook.