As the documentation says, the comparison function needs to return an integer that is either "less than, equal to, or greater than zero". There is no requirement to restrict the value returned to -1, 0, 1.
<?php
usort($array, function($a, $b) {
if($a->integer_property > $b->integer_property) {
return 1;
}
elseif($a->integer_property < $b->integer_property) {
return -1;
}
else {
return 0;
}
});
?>
can be simplified to
<?php
usort($array, function($a, $b) {
return $a->integer_property - $b->integer_property;
});
?>
This of course applies to any comparison function that calculates an integer "score" for each of its arguments to decide which is "greater".