3v4l.org

run code in 300+ PHP versions simultaneously
<?php class It implements \IteratorAggregate { public $gen; public function getIterator(): \Generator { yield 'foo'; $this->gen->throw(new Exception()); var_dump("not executed"); } public function __destruct() { var_dump(__METHOD__); } } function f($it) { try { var_dump(new stdClass, yield from $it); } finally { var_dump(__FUNCTION__); } } $it = new It(); $gen = f($it); $it->gen = $gen; var_dump($gen->current()); $gen->next(); gc_collect_cycles(); ?>
Output for git.master_jit, git.master, rfc.property-hooks
string(3) "foo" string(1) "f"
Process exited with code 139.

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