3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fiber = new Fiber(function() { $count = 3; echo "Start\n"; while(true) { Fiber::suspend(); // suspend the fiber echo "Are there results?\n"; $count--; if ($count === 0) { return; // We received the results, we stop } } }); $fiber->start(); // Initiates processing do { echo "Do something else\n"; $fiber->resume(); // Restart the fiber } while (!$fiber->isTerminated()); // The fiber has terminated echo "End\n";
Output for git.master_jit, git.master
Start Do something else Are there results? Do something else Are there results? Do something else Are there results? End

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:
32.9 ms | 405 KiB | 5 Q