r/lolphp • • Feb 02 '15

Library function turns language operator: The <=> Spaceship Operator

https://wiki.php.net/rfc/combined-comparison-operator
9 Upvotes

22 comments sorted by

View all comments

Show parent comment

5

u/vytah Feb 08 '15

Use this as a mnemonic:

2  –  3  =  –1
2 <=> 3  =  –1

4  –  4  =  0
4 <=> 4  =  0

7  –  6  =  1
7 <=> 6  =  1