3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 'EVENTNAME' => array ( 0 => 'Brexit', 1 => 'leave date set', 2 => 'leave date ', 3 => 'deal or no deal', ), 'IMMIGRATIONS' => array ( 0 => '1', 1 => '1', 2 => '1', 3 => '1', ), 'EFFECTS' => array ( 0 => '2', 1 => '1', 2 => '1', 3 => '2', ), 'SUPPLYCHAINS' => array ( 0 => '1', 1 => '1', 2 => '1', 3 => '1', ), ); $keys = array_keys($arr); foreach($arr[$keys[0]] as $key => $val){ $result[$val] = array_combine(array_slice($keys, 1), array_column(array_slice($arr,1), $key)); } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'Brexit' => array ( 'IMMIGRATIONS' => '1', 'EFFECTS' => '2', 'SUPPLYCHAINS' => '1', ), 'leave date set' => array ( 'IMMIGRATIONS' => '1', 'EFFECTS' => '1', 'SUPPLYCHAINS' => '1', ), 'leave date ' => array ( 'IMMIGRATIONS' => '1', 'EFFECTS' => '1', 'SUPPLYCHAINS' => '1', ), 'deal or no deal' => array ( 'IMMIGRATIONS' => '1', 'EFFECTS' => '2', 'SUPPLYCHAINS' => '1', ), )

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