3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1() { yield 1; echo "Sup from gen1\n"; yield 2; yield 3; } function gen2() { try { yield from gen1(); } catch (Exception $e) { echo "Sup from gen2!\n"; yield 10; } } function gen3() { yield from gen2(); } $g = gen3(); // Prime the generator $g->valid(); $g->next(); $g->throw(new Exception("Whoa there lassie")); $g->current();
Output for git.master, git.master_jit, rfc.property-hooks
Sup from gen1 Sup from gen2!

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:
57.58 ms | 405 KiB | 9 Q