3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 1; $i <= 10; $i++) { try { switch ($i) { case 2: throw new Exception($i); break; case 4: throw new RuntimeException($i); break; } } catch (RuntimeException $e) { echo 'Caught RuntimeException: '. $e->getMessage() . PHP_EOL; } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage() . PHP_EOL; } echo 'Loop count: '. $i . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Loop count: 1 Caught exception: 2 Loop count: 2 Loop count: 3 Caught RuntimeException: 4 Loop count: 4 Loop count: 5 Loop count: 6 Loop count: 7 Loop count: 8 Loop count: 9 Loop count: 10

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