Re: [PHP-DEV] Spaceship and NaNs

2015-06-15 Thread Stanislav Malyshev
Hi! >> Just because other comparison ops already return a bool, we can return >> bool(false) there. But we can not return bool from operator that is declared as returning int, and adding extra type would make this operator essentially useless, as it is meant to be a concise way of comparing two t

Re: [PHP-DEV] Spaceship and NaNs

2015-06-15 Thread Bishop Bettini
On Mon, Jun 15, 2015 at 4:45 PM, Rowan Collins wrote: > On 15 June 2015 20:55:04 BST, Bob Weinand wrote: > >As far as I know, we made it that way in order to enforce an int return > >type all the time. > >int(-1) is indeed the sensible value for this. (Mainly int(0) does not > >work because it'd

Re: [PHP-DEV] Spaceship and NaNs

2015-06-15 Thread Rowan Collins
On 15 June 2015 20:55:04 BST, Bob Weinand wrote: >As far as I know, we made it that way in order to enforce an int return >type all the time. >int(-1) is indeed the sensible value for this. (Mainly int(0) does not >work because it'd mean equality and so we're left with int(-1) and >int(1).) > >Jus

RE: [PHP-DEV] Spaceship and NaNs

2015-06-15 Thread Anatol Belski
> -Original Message- > From: Bob Weinand [mailto:bobw...@hotmail.com] > Sent: Monday, June 15, 2015 9:55 PM > To: Dmitry Stogov > Cc: da...@php.net; Andrea Faulds; Stanislav Malyshev; Anatol Belski; Kalle > Sommer Nielsen; PHP Internals > Subject: Re: [PHP-DEV] Space

Re: [PHP-DEV] Spaceship and NaNs

2015-06-15 Thread Bob Weinand
As far as I know, we made it that way in order to enforce an int return type all the time. int(-1) is indeed the sensible value for this. (Mainly int(0) does not work because it'd mean equality and so we're left with int(-1) and int(1).) Just because other comparison ops already return a bool, w