3v4l.org

run code in 300+ PHP versions simultaneously
<?php function emptyGenerator(): Generator { var_dump('Generator function started'); if (false) { yield 'some value'; } var_dump('Generator function finished'); } $generator = emptyGenerator(); 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(27) "Generator function finished" string(18) "Generator is empty"

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.14 ms | 405 KiB | 5 Q