3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new ArrayObject(); $a['b'] = 10; $a[1] = 22; foreach ($a as $b) { print_r($b . PHP_EOL); } iterator_apply($a, fn ($x) => print_r($x . PHP_EOL));
Output for git.master_jit, rfc.property-hooks
10 22 Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 0 passed and exactly 1 expected in /in/sf0Hb:9 Stack trace: #0 [internal function]: {closure}() #1 /in/sf0Hb(9): iterator_apply(Object(ArrayObject), Object(Closure)) #2 {main} thrown in /in/sf0Hb on line 9
Process exited with code 255.
Output for git.master
10 22 Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure:/in/sf0Hb:9}(), 0 passed and exactly 1 expected in /in/sf0Hb:9 Stack trace: #0 [internal function]: {closure:/in/sf0Hb:9}() #1 /in/sf0Hb(9): iterator_apply(Object(ArrayObject), Object(Closure)) #2 {main} thrown in /in/sf0Hb on line 9
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:
89.54 ms | 407 KiB | 5 Q