Re: [RFC] Combined Comparison (Spaceship) Operator
| From: | Yasuo Ohgaki | Date: | Fri, 23 Jan 2015 00:16:34 +0000 |
| Subject: | Re: [RFC] Combined Comparison (Spaceship) Operator | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81005@lists.php.net to get a copy of this message | ||
Hi all,
On Fri, Jan 23, 2015 at 7:48 AM, Larry Garfield <larry@garfieldtech.com>
wrote:
> The examples say nothing about mixing types, though. Eg, what would these
> return:
>
> return 0 <=> "0"
>
> return "" <=> 0
>
> return 1 <=> [1, 2, 3]
>
> Ignoring object property names and going by the order of the property
> definition seems like asking for trouble, too.
>
It should be the same as '===', IMO.
Only the same type should return 0.
Object has the same id should return 0.
Arrays would be matter of discussion.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net