Home > PHP > PHP 7 introduces the spaceship (<=>) operator
Bookmark and Share

PHP 7 introduces the spaceship (<=>) operator

Posted on April 19, 2017 | Filed in PHP

So what exactly is the spaceship (<=>) operator?

Return 0 if values on either side are equal
Return 1 if value on the left is greater
Return -1 if the value on the right is greater

Leave a Reply