3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input['links']["link"] = ["onet.pl", "wp.pl"]; $input['links']["title"] = ["Link 1", "Link 2"]; function rebuildArray($input) { foreach($input['links'] as $key => $value) { $index = 0; foreach($value as $value2) { $arr2[$index++][$key]=$value2; } } $output['links'] = $arr2; return $output; } var_dump(rebuildArray($input));
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["links"]=> array(2) { [0]=> array(2) { ["link"]=> string(7) "onet.pl" ["title"]=> string(6) "Link 1" } [1]=> array(2) { ["link"]=> string(5) "wp.pl" ["title"]=> string(6) "Link 2" } } }

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:
65.85 ms | 401 KiB | 8 Q