3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array ( "group_name_1" => "audi", "group_locations_1" => "tokyo,barcelona,paris", "group_quantities_at_locations_1" => "1,2,7", "group_name_2" => "ford", "group_locations_2" => "london,prag", "group_quantities_at_locations_2" => "3,6" ); $result = []; $function = function($v) use (&$result){ $result[$v[0]] = array_combine(explode(",",$v[1]),explode(",",$v[2])); }; array_walk(array_chunk($input,3),$function); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Notice: Only variables should be passed by reference in /in/eTjtp on line 17 Array ( [audi] => Array ( [tokyo] => 1 [barcelona] => 2 [paris] => 7 ) [ford] => Array ( [london] => 3 [prag] => 6 ) )

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:
49.23 ms | 402 KiB | 8 Q