3v4l.org

run code in 300+ PHP versions simultaneously
<?php $homepage = array(); $homepage[] = '{ "info": { "collection": [ { "Name": "Charlie", "ID": "7" }, { "Name": "Emma", "ID": "9" }, { "Name": "Laura", "ID": "11" } ] } }'; $homepage[] = '{ "info": { "collection": [ { "Name": "Jim", "ID": "12" }, { "Name": "Sam", "ID": "56" }, { "Name": "Bob", "ID": "5" } ] } }'; foreach ($homepage as $homepage2) { $data = json_decode($homepage2, false); usort($data->info->collection, function ($a, $b) { return $b->ID - $a->ID; }); foreach($data->info->collection as $key) { echo' '.$key->ID.' '.$key->Name.' '; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
11 Laura 9 Emma 7 Charlie 56 Sam 12 Jim 5 Bob

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