What does the spaceship operator () return?
- A -1, 0 or 1 depending on whether the left is less than, equal to or greater than the right
- B true or false
- C The larger of two values
- D The difference between two numbers
Answer
-1, 0 or 1 depending on whether the left is less than, equal to or greater than the right
It was introduced in PHP 7 and is designed for use in usort and similar comparison callbacks.





