3v4l.org

run code in 300+ PHP versions simultaneously
<?php class GenClass { function __construct() { echo "Making GenClass\n"; } function __destruct() { echo "Destroying GenClass\n"; } function genInner() { throw new Exception; yield 5; } } function genOuter() { $x = (new GenClass)->genInner(); // $x is now a generator containing the only reference to a GenClass yield from $x; } genOuter()->next();
Output for git.master, git.master_jit, rfc.property-hooks
Making GenClass Destroying GenClass Fatal error: Uncaught Exception in /in/iTdQJ:6 Stack trace: #0 /in/iTdQJ(11): GenClass->genInner() #1 [internal function]: genOuter() #2 /in/iTdQJ(14): Generator->next() #3 {main} thrown in /in/iTdQJ on line 6
Process exited with code 255.

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:
50.63 ms | 401 KiB | 8 Q