3v4l.org

run code in 300+ PHP versions simultaneously
<?php class load { public static function createException($c) { var_dump('create'); eval('class '.$c.' extend Exception {}'); } public static function loadClass($c) { var_dump('load'); try { self::loadCache($c); } catch (NotFoundException $e) { eval('class '.$c.'{}'); } } public static function loadCache($c) { throw new NotFoundException; } } spl_autoload_register(array('load', 'loadClass')); spl_autoload_register(array('load', 'createException')); new x;
Output for git.master, git.master_jit, rfc.property-hooks
string(4) "load" string(4) "load" Fatal error: Uncaught Error: Class "NotFoundException" not found in /in/5FikG:26 Stack trace: #0 /in/5FikG(16): load::loadCache('NotFoundExcepti...') #1 /in/5FikG(26): load::loadClass('NotFoundExcepti...') #2 /in/5FikG(16): load::loadCache('x') #3 /in/5FikG(33): load::loadClass('x') #4 {main} thrown in /in/5FikG on line 26
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:
41.04 ms | 402 KiB | 8 Q