3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ping_pong() { for ($i = 1; $i <= 10; $i++) { echo 'a' . $i; $val = (yield $i); echo 'b' . $i; echo 'ping: ' . $val . PHP_EOL; echo 'c' . $i; } } $generator = ping_pong(); foreach ($generator as $value) { echo 'pong: ' . $generator->send($value) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
a1b1ping: 1 c1a2pong: 2 b2ping: c2a3b3ping: 3 c3a4pong: 4 b4ping: c4a5b5ping: 5 c5a6pong: 6 b6ping: c6a7b7ping: 7 c7a8pong: 8 b8ping: c8a9b9ping: 9 c9a10pong: 10 b10ping: c10

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