3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected function order($a, $b) { if ($a == $b) { return 0; } return ($a < $b) ? -1 : 1; } public function sortStuff($arr) { usort($arr, [$this, 'order']); return $arr; } } $f = new Foo(); print_r($f->sortStuff([5, 6, 8, 3, 7, 9]));

preferences:
15.61 ms | 402 KiB | 5 Q