Answers for "what spaceship operator does"

PHP
0

spaceship operator

function cmp_php5($a, $b) {
    return ($a < $b) ? -1 : (($a >$b) ? 1 : 0);
}

function cmp_php7($a, $b) {
    return $a <=> $b;
}
Posted by: Guest on June-22-2021

Code answers related to "what spaceship operator does"

Browse Popular Code Answers by Language