3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => array ( 'N_127y4Gral' => array ( 0 => '302', ), ), 1 => array ( 'N_127y4Gral' => array ( 0 => '288', ), ), 2 => array ( 'N_144y4Gral' => array ( 0 => '317', ), ), 3 => array ( 'N_144y4Gral' => array ( 0 => '307', ), ), 4 => array ( 'N_144y4Gral' => array ( 0 => '332', ), )); foreach($arr as $sub){ foreach($sub as $key => $val){ $res[$key][] = $val[0]; if(!isset($count[$key])){ $count[$key] = 1; }else{ $count[$key]++; } } } $max = max($count); foreach($res as &$subarray){ $subarray = array_merge($subarray, array_fill(0,$max-count($subarray), 0)); } var_dump($res);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["N_127y4Gral"]=> array(3) { [0]=> string(3) "302" [1]=> string(3) "288" [2]=> int(0) } ["N_144y4Gral"]=> &array(3) { [0]=> string(3) "317" [1]=> string(3) "307" [2]=> string(3) "332" } }

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