3v4l.org

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

preferences:
53.91 ms | 402 KiB | 5 Q