3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generator(): Generator { var_dump('Generator function started'); yield 'some value'; var_dump('Generator function finished'); } $generator = generator(); var_dump('About to call $generator->valid()'); if ($generator->valid()) { var_dump('Generator is not empty, traversing'); foreach ($generator as $value) { var_dump('Generator yielded '.$value); } var_dump('Finished traversing generator'); } else { var_dump('Generator is empty'); }
Output for git.master, git.master_jit, rfc.property-hooks
string(33) "About to call $generator->valid()" string(26) "Generator function started" string(34) "Generator is not empty, traversing" string(28) "Generator yielded some value" string(27) "Generator function finished" string(29) "Finished traversing generator"

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:
133.66 ms | 406 KiB | 5 Q