3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Foo() { for ($i = 11; $i < 12; $i++) { echo 'In Foo.......',"\n"; $string=(yield $i); if (isset($string)) { echo "foo displaying sent data: "; echo "$string\n"; } } echo 'Foo is closed.',"\n"; return; } $gen = foo(); foreach ($gen as $value) { echo "Back in \$gen ........\n"; echo "Fetched value is $value\n"; if ($value == 11) { echo "\$gen injecting ....\n"; $gen->send('Hello World'); } echo "\$gen done working!\n"; } unset($gen); if(!isset($gen)) echo "\$gen is history\n";
Output for git.master, git.master_jit, rfc.property-hooks
In Foo....... Back in $gen ........ Fetched value is 11 $gen injecting .... foo displaying sent data: Hello World Foo is closed. $gen done working! $gen is history

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