3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { echo "1 try\n"; try { echo "2 try\n"; // 必ず try 中で例外が投げられる throw new \Exception("in try exception"); } catch(\Exception $e) { echo "3 catch\n"; echo " ". $e->getMessage()."\n"; throw $e;// ここで try 由来の例外を更に上に投げる } finally { echo "4 finally\n"; // finally 中でも例外を投げる throw new \Exception("in finally exception"); } } catch(\Exception $e) { // ↑の投げられた例外をキャッチ echo "5 catch\n"; echo " ". $e->getMessage()."\n"; } finally { echo "6 finally\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
1 try 2 try 3 catch in try exception 4 finally 5 catch in finally exception 6 finally

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:
56.81 ms | 405 KiB | 5 Q