3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define class constant linking to a not defined constant const CONST_FOO = FOO; const CONST_BAR = BAR; echo "Define the linked constant AFTER reading:\n"; CONST_FOO; define('FOO', 'Value of FOO'); var_dump(CONST_FOO); echo "Define the linked constant BEFORE reading:\n"; define('BAR', 'Value of BAR'); var_dump(CONST_BAR);

preferences:
37.92 ms | 402 KiB | 5 Q