<=>是 Spaceship operator
太空船操作符:三向的比较数字操作符
$a<=>$b 这个操作符比较两个数字,返回-1,0,1。
返回1 $a>$b
返回0 $a=$b
返回-1 $a<$b
比如:
$a = 5 <=> 7; # $a is set to -1
$a = 7 <=> 5; # $a is set to 1
$a = 6 <=> 6; # $a is set to 0
比较大小,$num1<=>$num2,是指比较两个数的大小,如果$num1>$num2返回1;如果$num1=$num2返回0;如果$num1<$num2返回-1