PHPverse 2025

Voting

: nine minus eight?
(Example: nine)

The Note You're Voting On

raveren at gmail dot com
5 months ago
Since php7.0 you can replace this boilerplate

if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;

with the spaceship operator:
https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.spaceship-op

return $a <=> $b;

<< Back to user notes page

To Top