3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "example": "1", "example2": 2, "text": "3", "info": { "agent": 4, "sum": 5, "collection": [{ "Name": "6", "Pic": "7" }, { "Name": "8", "Pic": "9" }, { "Name": "10", "Pic": "11" }] } }'; $result = json_decode ($json, true); foreach($result as $key => $value){ if($key == 'info'){ $keys = array_keys($value['collection']); array_multisort( array_column($value['collection'], 'Pic'), SORT_DESC, SORT_NUMERIC, $value['collection'], $keys ); $value = array_combine($keys, $value['collection']); foreach($value as $val){ echo $val['Pic']." - ".$val['Name']."\n"; } } }
Output for git.master, git.master_jit, rfc.property-hooks
11 - 10 9 - 8 7 - 6

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:
57.49 ms | 401 KiB | 8 Q