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, ]; $formattedArray = []; array_walk($array, function($value, $key) use (&$formattedArray) { list($prefix, $newKey) = explode('_c_', $key); $formattedArray[$prefix][$newKey] = $value; }); var_dump($formattedArray);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["pentrose_50_rafhan"]=> array(4) { ["kgs"]=> int(100) ["issued_kgs"]=> int(300) ["rskg"]=> float(99.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:
29.61 ms | 405 KiB | 5 Q