3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ '71-ctns' => 1, '71-units' => 1, '308-units' => 1, '305-ctns' => 1, '306-units' => 2, ]; $result = []; foreach ($array as $k => $v) { [$id, $label] = explode('-', $k); $result[$id][$label] = $v; } var_export($result);
Output for git.master_jit, git.master, rfc.property-hooks
array ( 71 => array ( 'ctns' => 1, 'units' => 1, ), 308 => array ( 'units' => 1, ), 305 => array ( 'ctns' => 1, ), 306 => array ( 'units' => 2, ), )

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.16 ms | 1034 KiB | 4 Q