
PHP Strict Typing - eamann
https://ttmm.io/php/strict-typing/
======
rurban
A type violation is a run-time exception, not a compile-time error? Cannot
believe this.

~~~
eamann
PHP isn't a compiled language. Exceptions are thrown when the code is loaded
into the interpreter and said interpreter notices the error.

~~~
rurban
No, that is not how it works. PHP is not AST interpreted anymore, there is a
distinction between compile-time and run-time. And this error is compile-time,
otherwise it would make no sense at all.

~~~
eamann
Yes and no.

This is a PHP Fatal Error, which will cause execution to stop. But the
compiler doesn't compile the entire file in the same way you'd see with other
languages. Any code in a PHP file _before_ the type error will still execute
just fine, but when the PHP engine hits the error it will fatal and throw a
TypeError (along with a stack trace, depending on the verbosity of your
configuration).

