3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = array( array( array("Color" => "Blue"), array("Size" => "S") ), array( array("Color" => "Blue"), array("Size" => "M") ) ); $new_items = array_map(function ($item) { return array_map(function ($key_values) { return array_reduce($key_values, function ($seed, $value, $key) { $seed[$key] = $value; }); }, $item); }, $items);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 2 passed and exactly 3 expected in /in/d7URn:14 Stack trace: #0 [internal function]: {closure}(NULL, 'Blue') #1 /in/d7URn(14): array_reduce(Array, Object(Closure)) #2 [internal function]: {closure}(Array) #3 /in/d7URn(13): array_map(Object(Closure), Array) #4 [internal function]: {closure}(Array) #5 /in/d7URn(12): array_map(Object(Closure), Array) #6 {main} thrown in /in/d7URn on line 14
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:
51.24 ms | 402 KiB | 8 Q