3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &gen() { yield 'foo'; return 'Literal'; } $gen = gen(); var_dump($gen->current()); foreach($gen as $a) { print $a; } print $gen->getReturn(); ?>
Output for git.master_jit, git.master
Notice: Only variable references should be yielded by reference in /in/KQ4Nq on line 4 string(3) "foo" fooLiteral

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:
58.17 ms | 850 KiB | 4 Q