3v4l.org

run code in 300+ PHP versions simultaneously
<?php function & genRefInner() { $var = 1; yield $var; } function & genRefOuter() { return genRefInner(); } foreach(genRefOuter() as $i) { var_dump($i); }

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

Output for branch master
Notice: Only variable references should be returned by reference in /in/sFR11 on line 9 int(1)
Output for branch partials
Notice: Only variable references should be returned by reference in /in/sFR11 on line 9 int(1)

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