3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace MyProject; define('CONSTANT', 'asdf'); function mine() { var_dump('mine'); } function func() { var_dump('func'); } class CName { function __construct() { var_dump('__contruct'); } static function method() { var_dump('method'); } } namespace\mine(); // calls function MyProject\blah\mine() namespace\func(); // calls function MyProject\func() namespace\cname::method(); // calls static method "method" of class MyProject\cname $a = new namespace\cname(); // instantiates object of class MyProject\sub\cname $b = namespace\CONSTANT; // assigns value of constant MyProject\CONSTANT to $b ?>
Output for git.master, git.master_jit, rfc.property-hooks
string(4) "mine" string(4) "func" string(6) "method" string(10) "__contruct" Fatal error: Uncaught Error: Undefined constant "MyProject\CONSTANT" in /in/6k2qd:37 Stack trace: #0 {main} thrown in /in/6k2qd on line 37
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:
43.12 ms | 401 KiB | 8 Q