note 117870 deleted from language.operators.comparison by cmb
| From: | cmb@php.net | Date: | Tue, 05 Nov 2019 14:44:07 +0000 |
| Subject: | note 117870 deleted from language.operators.comparison by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212936@lists.php.net to get a copy of this message | ||
Note Submitter: Hayley Watson
----
When the comparison rules for the spaceship operator say that for
"object<=>anything" the object is always greater, and for
"array<=>anything" the array is always greater.
The rules should be used in the order they are listed. In the latter case, "anything"
means "anything except an object".
The former rule says that "object<=>array" will always decide that the object is
greater (and evaluate to a positive integer); to be consistent, the comparison
"array<=>object" must also always decide that the object is greater (and evaluate to
a negative integer).