Constants Can Be Impossible

../_images/when_a_constant_is_impossible.png

In this code, the constant x2::F is not possible, because adding a string and an array results in a fatal error.

Yet, this is determined at execution time, and only when the constant is used.

Since this constant is never used, its code is never executed, and it doesn’t yield any error. PHP has optimized the error away.

See Also

PHP Features