3v4l.org

run code in 300+ PHP versions simultaneously
<?php const INT = static function($x) {return (int)$x * (int)$x;}; echo (int)(" 123s "); // fatal error // echo ((int))(" 123s "); const ant = static function($x) {return (int)$x * (int)$x;}; echo (ant)(" 123s "); echo ((ant))(" 123s ");
Output for 8.5.0 - 8.5.3
1231512915129
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.17
Fatal error: Constant expression contains invalid operations in /in/nQXAL on line 3
Process exited with code 255.

preferences:
156.62 ms | 1307 KiB | 6 Q