3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "id": "220", "pin_list": [ { "id": "1", "name": "1. La Sagrada Familia" }, { "id": "2", "name": "2. Park Guell" }, { "id": "3", "name": "10. Casa Batllo" }, { "id": "4", "name": "11. Cathedral of Barcelona" }, { "id": "5", "name": "3. Picasso Museum" }, { "id": "6", "name": "Zebra" }, { "id": "7", "name": "Apple" }, { "id": "8", "name": "Monkey" } ] }'; $array = json_decode($json, true); usort($array['pin_list'], function ($a, $b) { return strnatcmp($a['name'], $b['name']); }); echo json_encode($array, JSON_PRETTY_PRINT);
Output for git.master, git.master_jit, rfc.property-hooks
{ "id": "220", "pin_list": [ { "id": "1", "name": "1. La Sagrada Familia" }, { "id": "2", "name": "2. Park Guell" }, { "id": "5", "name": "3. Picasso Museum" }, { "id": "3", "name": "10. Casa Batllo" }, { "id": "4", "name": "11. Cathedral of Barcelona" }, { "id": "7", "name": "Apple" }, { "id": "8", "name": "Monkey" }, { "id": "6", "name": "Zebra" } ] }

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:
85.44 ms | 402 KiB | 8 Q