3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six', 7 => 'seven', 8 => 'eight', 9 => 'nine' ); foreach ($array as $key => $value) { try { if ($key === 2) { throw new Exception("Key 2 Exception ({$value})"); } echo $value . "\n"; } catch (Exception $e) { echo $e->getMessage() . "\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
zero one Key 2 Exception (two) three four five six seven eight nine

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:
61.12 ms | 401 KiB | 8 Q