3v4l.org

run code in 300+ PHP versions simultaneously
<?php const CONST1 = [$foo]; $foo = 1; if (isset(CONST1[$foo])) { echo $foo; }
Output for 7.1.0 - 7.1.17, 7.2.0 - 7.2.6
Fatal error: Constant expression contains invalid operations in /in/mbu4g on line 3
Process exited with code 255.

preferences:
172.06 ms | 1395 KiB | 32 Q