3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonArray = '[{"Level":"77.2023%","Product":"Milk","Temperature":"4"}, {"Level":"399.2023%","Product":"Coffee","Temperature":"34"}, {"Level":"109.2023%","Product":"Chocolate","Temperature":"14"}]'; $output = array(); foreach (json_decode($jsonArray, true) as $row) { $product = $row['Product']; $output[$product] = $row; unset($output[$product]['Product']); } echo json_encode($output) . "\n";
Output for git.master, git.master_jit, rfc.property-hooks
{"Milk":{"Level":"77.2023%","Temperature":"4"},"Coffee":{"Level":"399.2023%","Temperature":"34"},"Chocolate":{"Level":"109.2023%","Temperature":"14"}}

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