3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "pentrose_50_rafhan_c_kgs" => 100, "pentrose_50_rafhan_c_issued_kgs" => 300, "pentrose_50_rafhan_c_rskg" => 99.1, "pentrose_50_rafhan_c_amount" => 29730, ]; $newArray[explode('_c_', current(($keys = array_keys($array))))[0]] = array_map(fn($key) => [explode('_c_', $key)[1] => $array[$key]], $keys); var_dump($newArray);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["pentrose_50_rafhan"]=> array(4) { [0]=> array(1) { ["kgs"]=> int(100) } [1]=> array(1) { ["issued_kgs"]=> int(300) } [2]=> array(1) { ["rskg"]=> float(99.1) } [3]=> array(1) { ["amount"]=> int(29730) } } }

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:
97.22 ms | 406 KiB | 5 Q