3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ping_pong() { for ($i = 1; $i <= 10; $i++) { echo 'a' . $i . PHP_EOL; $val = (yield $i); echo 'b' . $i . PHP_EOL; //echo 'ping: ' . $val . PHP_EOL; } } $generator = ping_pong(); foreach ($generator as $value) { echo 'c' . $i . PHP_EOL; //echo 'pong: ' . $generator->send($value) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
a1 Warning: Undefined variable $i in /in/3t0EW on line 17 c b1 a2 Warning: Undefined variable $i in /in/3t0EW on line 17 c b2 a3 Warning: Undefined variable $i in /in/3t0EW on line 17 c b3 a4 Warning: Undefined variable $i in /in/3t0EW on line 17 c b4 a5 Warning: Undefined variable $i in /in/3t0EW on line 17 c b5 a6 Warning: Undefined variable $i in /in/3t0EW on line 17 c b6 a7 Warning: Undefined variable $i in /in/3t0EW on line 17 c b7 a8 Warning: Undefined variable $i in /in/3t0EW on line 17 c b8 a9 Warning: Undefined variable $i in /in/3t0EW on line 17 c b9 a10 Warning: Undefined variable $i in /in/3t0EW on line 17 c b10

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.02 ms | 402 KiB | 8 Q