3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ex = [ 'goo' => [ 1, 2 ], 'asdads' => [ 3, 4 ] ]; $test = array_reduce($ex, function ($a, $b) { if (null === $a) { $a = []; } call_user_func_array('array_push', $b); return $a; }); var_dump($test);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: array_push(): Argument #1 ($array) must be passed by reference, value given in /in/qcuPh on line 16 Fatal error: Uncaught TypeError: array_push(): Argument #1 ($array) must be of type array, int given in /in/qcuPh:16 Stack trace: #0 /in/qcuPh(16): array_push(1, 2) #1 [internal function]: {closure}(Array, Array) #2 /in/qcuPh(11): array_reduce(Array, Object(Closure)) #3 {main} thrown in /in/qcuPh on line 16
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:
172.17 ms | 406 KiB | 5 Q