@ 2015-12-02T11:39:40Z <?php
class Person {
public $sname;
public $fname;
public $age;
public function __construct($a,$b,$c) {
$this->sname = $a;
$this->fname = $b;
$this->age = $c;
return $this;
}
}
$horrible_array_of_stuff = array( new Person("Owen", "Dyckhoff", 27), new Person("Joe", "Bloggs", 36 ) );
print_r($horrible_array_of_stuff);
echo "Sorting Array of Objects\n"
usort( $horrible_array_of_stuff, function( $left, $right ) {
return [$left->sname, $left->fname, $left->age] <=> [$right->sname, $right->fname, $right->age];
}
);
print_r($horrible_array_of_stuff);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.6.16 0.003 0.057 20.46 5.6.15 0.010 0.063 18.15 5.6.14 0.010 0.067 18.11 5.6.13 0.003 0.040 18.23 5.6.12 0.017 0.040 21.14 5.6.11 0.000 0.047 21.14 5.6.10 0.003 0.090 21.01 5.6.9 0.013 0.067 21.08 5.6.8 0.013 0.083 20.26 5.5.30 0.003 0.067 17.97 5.5.29 0.003 0.093 17.99 5.5.28 0.000 0.043 20.88 5.5.27 0.003 0.083 20.73 5.5.26 0.017 0.053 20.89 5.5.25 0.013 0.057 20.59 5.5.24 0.037 0.060 20.04
preferences:dark mode live preview
125.33 ms | 1398 KiB | 7 Q