note 126373 deleted from language.operators.comparison by cmb
| From: | cmb@php.net | Date: | Mon, 30 Aug 2021 20:37:02 +0000 |
| Subject: | note 126373 deleted from language.operators.comparison by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216840@lists.php.net to get a copy of this message | ||
Note Submitter: hello at parbona dot net
----
When using spaceship(<=>) operator bellow those rules will apply.
Rules:
1. Return 0 if values on either side are equal.
2. Return 1 if the value on the left is greater.
3. Return -1 if the value on the right is greater.
Examples:
echo 1 <=> 1; //output 0
echo 3 <=> 4; //output -1
echo 4 <=> 3; //output 1