3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExceptionHandler { public static function printException(Exception $e) { print 'Uncaught '.get_class($e).', code: ' . $e->getCode() . "<br />Message: " . htmlentities($e->getMessage())."\n"; } public static function handleException(Exception $e) { self::printException($e); } } class NewException extends Exception {} try { throw new NewException("Catch me once", 1); } catch (Exception $e) { ExceptionHandler::handleException($e); } set_exception_handler(array("ExceptionHandler", "handleException")); throw new Exception("Catch me twice", 2); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Uncaught NewException, code: 1<br />Message: Catch me once Uncaught Exception, code: 2<br />Message: Catch me twice

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.37 ms | 401 KiB | 8 Q