3v4l.org

run code in 300+ PHP versions simultaneously
<?php $toSort = array( 1 => [ 'value' => 8000, 'key' => 1007 ], 2 => [ 'value' => 8001, 'key' => 1007 ], 3 => [ 'value' => 8002, 'key' => 1013 ], ); $result = []; foreach ($toSort as ['value' => $value, 'key' => $key]) { $result[$key][] = $value; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 1007 => array ( 0 => 8000, 1 => 8001, ), 1013 => array ( 0 => 8002, ), )

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:
25.43 ms | 405 KiB | 5 Q