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 . ':' . $val . PHP_EOL; //echo 'ping: ' . $val . PHP_EOL; } } $generator = ping_pong(); foreach ($generator as $value) { echo 'c' . $value . PHP_EOL; //echo 'pong: ' . $generator->send($value) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
a1 c1 b1: a2 c2 b2: a3 c3 b3: a4 c4 b4: a5 c5 b5: a6 c6 b6: a7 c7 b7: a8 c8 b8: a9 c9 b9: a10 c10 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:
44.51 ms | 401 KiB | 8 Q