3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'dates' => array('2013-04-22','2013-04-23'), 'publisherName' => array('Comp1', 'Comp2'), 'loaded' => array(2189, 37), 'clicks' => array(0, 0), 'ctr' => array(0, 0) ); $dates = array_shift($array); $output = array(); foreach ($array as $k => $a) { foreach ($a as $i => $v) { $output[$i][$k] = $v; } } $example = array_combine($dates, $output); var_dump($example);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["2013-04-22"]=> array(4) { ["publisherName"]=> string(5) "Comp1" ["loaded"]=> int(2189) ["clicks"]=> int(0) ["ctr"]=> int(0) } ["2013-04-23"]=> array(4) { ["publisherName"]=> string(5) "Comp2" ["loaded"]=> int(37) ["clicks"]=> int(0) ["ctr"]=> int(0) } }

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