3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register('var_dump'); spl_autoload_register(function ($class) { $classData = explode('\\', $class); if (count($classData) > 1) { $name = array_pop($classData); $namespace = implode('\\', $classData); eval('namespace '.$namespace.' { class '.$name.' { } }'); } else { eval('class '.$classData[0].' { }'); } }); new Foo(); new \Faz(); use Foo\Bar; new Bar(); use Foo\Baz as Cat; new Cat(); use Foo\Ciz; new Ciz\Caz();
Output for git.master, git.master_jit, rfc.property-hooks
string(3) "Foo" string(3) "Faz" string(7) "Foo\Bar" string(7) "Foo\Baz" string(11) "Foo\Ciz\Caz"

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:
39.54 ms | 401 KiB | 8 Q