to sort with numeric and empty values and have the smallest on top:
<?php
usort($list, function($a, $b) {
if( $a == null && $b != null ) return 1;
if( $a != null && $b == null ) return -1;
return $a > $b ? 1 : -1;
});
?>
returns
1
2
3
null
null
null