3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $rawData = array( array('name' => 'Kirk', 'time' => 11118888), array('name' => 'Spock', 'time' => 11114444), array('name' => 'Bones', 'time' => 11116666), array('name' => 'Scotty', 'time' => 11112222), ); $tempArray = array(); foreach ($rawData as $row) { $tempArray[$row['time']] = $row; } ksort($tempArray); foreach ($tempArray as $row) { echo "{$row['name']} => {$row['time']}\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Scotty => 11112222 Spock => 11114444 Bones => 11116666 Kirk => 11118888