3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a () { print_r('I was here'); yield 1; yield 2; yield 3; } function b (iterable $i, string $name) { print_r($name); foreach($i as $it) { print_r($it); } print_r(PHP_EOL); print_r(PHP_EOL); } $it = a(); b((array) [1, 2, 3], '[1, 2, 3]'); b((array) 1, '1'); b((array) $it, 'a()'); print_r(array_map(fn ($message) => 'a', (array) $it));
Output for git.master_jit, git.master
[1, 2, 3]123 11 a() Array ( )

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