3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [ 'group' => '1', 4 => '19', 6 => '27', 8 => '160', ], [ 'group' => '2', 4 => '20', 6 => '28', 8 => '200', ], ]; $output = []; foreach ($input as $subArray) { $group = $subArray['group']; unset($subArray['group']); foreach ($subArray as $setId => $variationId) { $output[] = [ 'group' => $group, 'es_variation_set_id' => $setId, 'es_variation_id' => $variationId, ]; } } var_dump($output);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> array(3) { ["group"]=> string(1) "1" ["es_variation_set_id"]=> int(4) ["es_variation_id"]=> string(2) "19" } [1]=> array(3) { ["group"]=> string(1) "1" ["es_variation_set_id"]=> int(6) ["es_variation_id"]=> string(2) "27" } [2]=> array(3) { ["group"]=> string(1) "1" ["es_variation_set_id"]=> int(8) ["es_variation_id"]=> string(3) "160" } [3]=> array(3) { ["group"]=> string(1) "2" ["es_variation_set_id"]=> int(4) ["es_variation_id"]=> string(2) "20" } [4]=> array(3) { ["group"]=> string(1) "2" ["es_variation_set_id"]=> int(6) ["es_variation_id"]=> string(2) "28" } [5]=> array(3) { ["group"]=> string(1) "2" ["es_variation_set_id"]=> int(8) ["es_variation_id"]=> string(3) "200" } }

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:
162.45 ms | 408 KiB | 5 Q