3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $foo = (yield 'strlen' => ['a']); $foo .= (yield 'strlen' => ['ab']); $foo .= (yield 'strlen' => ['abc']); yield $foo."final"; } function call_generator_function($g) { $args = $g->current(); $callable = $g->key(); while ($g->valid() && is_callable($callable)) { $return = call_user_func_array($callable, $args); $g->send($return); $args = $g->current(); $callable = $g->key(); } return $args; } $result = call_generator_function(foo()); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
string(8) "123final"

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.51 ms | 401 KiB | 8 Q