<?php class Foo { public function __toString() { return 'a'; } } $a = new Foo(); $b = new Foo(); $list = [$a, $b]; natcasesort($list); print_r($list);
You have javascript disabled. You will not be able to edit any code.