(int) And (ant)

../_images/int_and_ant.png

It is possible to store a Closure in a constant, since PHP 8.5. This means that the closure has to be called by storing the constant in parenthesis: this way, PHP first extracts the value of the constant, then, calls the closure.

There is something else that is between parenthesis: a cast. And cast has a very high priority. So, when a int constant is created, it still calls the cast, and ignores the constant.

May be constants should not be called as casts?

See Also

PHP Error Messages

PHP Features