The spaceship operator <=> (introduced in PHP 7.0) is a three-way comparison operator that returns:
<=>
echo 1 <=> 2; // -1 echo 2 <=> 2; // 0 echo 3 <=> 2; // 1
It's particularly useful for sorting callbacks and comparing multiple values.
Generating explanation with Claude AI...
This will use 10 credits