Re: [RFC] Combined Comparison (Spaceship) Operator
| From: | Yasuo Ohgaki | Date: | Fri, 23 Jan 2015 00:48:14 +0000 |
| Subject: | Re: [RFC] Combined Comparison (Spaceship) Operator | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81009@lists.php.net to get a copy of this message | ||
On Fri, Jan 23, 2015 at 9:43 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> Ok. Now I understand. Since we don't/can't define strictly typed
> less/greater than operator,
> it makes sense. It can be handles
>
I always realize silly mistake after I sent mails :(
It can be handled as
>
> if (get_type($a) != get_type($b)) { ... treat it as exception/error etc }
> return $a <=> $b;
>
--
Yasuo Ohgaki
yohgaki@ohgaki.net