3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input[0] = [ [1 => 5, 2 => 12, 11 => 15], [1 => 5, 2 => 12, 11 => 16], [1 => 4, 2 => 9, 11 => 15], [1 => 3, 2 => 9, 11 => 15], [1 => 3, 2 => 9, 11 => 16], [1 => 3, 2 => 13, 11 => 15], [1 => 3, 2 => 13, 11 => 16], [1 => 3, 2 => 12, 11 => 15], [1 => 3, 2 => 12, 11 => 16], [1 => 4, 2 => 9, 11 => 16], [1 => 4, 2 => 13, 11 => 15], [1 => 4, 2 => 13, 11 => 16], [1 => 4, 2 => 12, 11 => 15], [1 => 4, 2 => 12, 11 => 16], [1 => 5, 2 => 9, 11 => 15], [1 => 5, 2 => 13, 11 => 16] ]; $result = []; foreach ($input as $key => $array) { foreach ($array as [1 => $one, 2 => $two, 11 => $eleven]) { $result[$key][$one][$two][] = $eleven; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 5 => array ( 12 => array ( 0 => 15, 1 => 16, ), 9 => array ( 0 => 15, ), 13 => array ( 0 => 16, ), ), 4 => array ( 9 => array ( 0 => 15, 1 => 16, ), 13 => array ( 0 => 15, 1 => 16, ), 12 => array ( 0 => 15, 1 => 16, ), ), 3 => array ( 9 => array ( 0 => 15, 1 => 16, ), 13 => array ( 0 => 15, 1 => 16, ), 12 => array ( 0 => 15, 1 => 16, ), ), ), )

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:
124.05 ms | 407 KiB | 5 Q