Part IV: Revisiting PHP: Spaceship Operator

Posted on

Image Courtesy: ExtremeTech The spaceship operator is used for comparing two expressions. It returns -1, 0 or 1 when $a is respectively less than, equal to, or greater than $b. Comparisons are performed according to PHP’s usual type comparison rules. This is applied when balancing dual terms. What it give back is a minus one […]