3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function generate() { try { yield 1; yield 2; } finally { echo "finally\n"; } } foreach (generate() as $i) { echo $i, "\n"; throw new Exception(); }

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Array change keys
1 finally Fatal error: Uncaught Exception in /in/QX4qP:15 Stack trace: #0 {main} thrown in /in/QX4qP on line 15
Output for Lexical anon
1 finally
Output for Typed properties
1 finally Fatal error: Uncaught Exception in /in/QX4qP:15 Stack trace: #0 {main} thrown in /in/QX4qP on line 15

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