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) { $seed = array(); return array_reduce($item, function ($seed, $value) { return array_map(function function () { $seed[] = $value; }, $key_values); return $seed; }, array()); }, $items); var_dump($new_items);
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting '(' in /in/BeRi0 on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_FUNCTION, expecting '(' in /in/BeRi0 on line 16
Process exited with code 255.

preferences:
182.46 ms | 1394 KiB | 62 Q