3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(array_reduce(['foo', 'bar'], function (array &$agg, $val) { $agg[] = $val; }, [42]));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: {closure}(): Argument #1 ($agg) must be passed by reference, value given in /in/ATrOU on line 3 Warning: {closure}(): Argument #1 ($agg) must be passed by reference, value given in /in/ATrOU on line 3 Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($agg) must be of type array, null given in /in/ATrOU:3 Stack trace: #0 [internal function]: {closure}(NULL, 'bar') #1 /in/ATrOU(3): array_reduce(Array, Object(Closure), Array) #2 {main} thrown in /in/ATrOU on line 3
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:
41.81 ms | 402 KiB | 8 Q