3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(Array ( 0 => "ISP2", 1 => "ISP3", 2 => "ISP4" ), Array ( 0 => "NAME-A", 1 => "NAME-B", 2 => "NAME-C" ), Array ( 0 => "property1", 1 => "property2", 2 => "property2" )); $result = array(); Foreach($arr[2] as $key => $prop){ $result[$prop]["charges"][] =$arr[0][$key]; $result[$prop]["names"][] = $arr[1][$key]; } Var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["property1"]=> array(2) { ["charges"]=> array(1) { [0]=> string(4) "ISP2" } ["names"]=> array(1) { [0]=> string(6) "NAME-A" } } ["property2"]=> array(2) { ["charges"]=> array(2) { [0]=> string(4) "ISP3" [1]=> string(4) "ISP4" } ["names"]=> array(2) { [0]=> string(6) "NAME-B" [1]=> string(6) "NAME-C" } } }

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:
35.14 ms | 406 KiB | 5 Q