3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Exception_Foo extends Exception {} class Exception_Bar extends Exception {} function foo() { throw new Exception_Foo('thing happened'); } function bar() { try { foo(); } catch (Exception_Foo $e) { throw new Exception_Bar("Exception_Foo caught: " . $e->getMessage()); } } function baz() { try { bar(); } catch (Exception_Bar $e) { print_r($e); } } baz();
Output for git.master, git.master_jit, rfc.property-hooks
Exception_Bar Object ( [message:protected] => Exception_Foo caught: thing happened [string:Exception:private] => [code:protected] => 0 [file:protected] => /in/FYn9p [line:protected] => 16 [trace:Exception:private] => Array ( [0] => Array ( [file] => /in/FYn9p [line] => 23 [function] => bar [args] => Array ( ) ) [1] => Array ( [file] => /in/FYn9p [line] => 29 [function] => baz [args] => Array ( ) ) ) [previous:Exception:private] => )

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:
44.34 ms | 403 KiB | 8 Q