3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const BAR = 42; } var_dump(constant('Foo::BAR')); var_dump(define('Foo::LOL', 37)); var_dump(Foo::LOL);
Output for git.master, git.master_jit, rfc.property-hooks
int(42) Fatal error: Uncaught ValueError: define(): Argument #1 ($constant_name) cannot be a class constant in /in/9W5f5:6 Stack trace: #0 /in/9W5f5(6): define('Foo::LOL', 37) #1 {main} thrown in /in/9W5f5 on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
33.31 ms | 401 KiB | 8 Q