3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object) ['ID' => 1, 'name' => 'Mary Jane', 'count' => '420'], (object) ['ID' => 2, 'name' => 'Johnny', 'count' => '23420'], (object) ['ID' => 3, 'name' => 'Kathy', 'count' => '4354'], ]; $property = 'count'; usort($array, fn($a,$b) => $a->$property <=> $b->$property); var_export($array);

preferences:
23 ms | 405 KiB | 5 Q