3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ new StdClass, new StdClass, new StdClass, ]; $arr[0]->path_to_file = "roberson_wine_5"; $arr[0]->order = 2; $arr[1]->path_to_file = "roberson_wine_5"; $arr[1]->order = 3; $arr[2]->path_to_file = "roberson_wine_3"; $arr[2]->order = 1; print_r($arr); usort($arr, function($a, $b){ if($a->order == $b->order) return 0; return $a->order > $b->order ? 1: -1; }); print_r($arr);

preferences:
37.06 ms | 402 KiB | 5 Q