3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Wtf { public function __get($property) { \Fiber::suspend(); echo "hi " . $property . "\n"; } } $fibers[] = new \Fiber(function () { $wtf = new Wtf(); echo $wtf->a; }); $fibers[] = new \Fiber(function () { $wtf = new Wtf(); echo $wtf->b; }); while (\count($fibers) > 0) { foreach ($fibers as $key => $fiber) { if (!$fiber->isStarted()) { $fiber->start(); } elseif ($fiber->isSuspended()) { $fiber->resume(); } // If the Fiber hasn't terminated by this point, move onto the next // placeholder, we'll resume this Fiber again when we get back here. if (!$fiber->isTerminated()) { continue; } unset($fibers[$key]); } }
Output for git.master_jit, git.master
hi a hi b

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:
40.17 ms | 833 KiB | 4 Q