3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function($class) { throw new Exception("Could not load $class"); }); spl_autoload_register(function($class) { if ($class == "Widget") { eval('class Widget { }'); } }); spl_autoload_register(function($class) { throw new Exception("Still could not load $class"); }); try { new Foo(); } catch (Exception $e) { for ($i = 1; $e; $e = $e->getPrevious()) printf("#%d Foo: %s\n", $i++, $e->getMessage()); } finally { var_dump(class_exists("Foo", false)); } try { new Widget(); } catch (Exception $e) { for ($i = 1; $e; $e = $e->getPrevious()) printf("#%d Foo: %s\n", $i++, $e->getMessage()); } finally { var_dump(class_exists("Widget", false)); }
Output for git.master, git.master_jit, rfc.property-hooks
#1 Foo: Could not load Foo bool(false) #1 Foo: Could not load Widget bool(false)

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