Re: Reviving scalar type hints
| From: | Lester Caine | Date: | Tue, 17 Feb 2015 15:56:30 +0000 |
| Subject: | Re: Reviving scalar type hints | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82977@lists.php.net to get a copy of this message | ||
On 17/02/15 15:30, François Laupretre wrote:
>> Returning 'not-zero/empty' as true and 'zero' as false is one of the
>> > natural things to use in PHP and I don't think any other language has
>> > that flexibility?
> You didn't read it right.
>
> I was talking of conversions *from* bool, not *to* bool. (int -> bool) is fine and will be
> preserved, but I propose to remove (bool -> int). You will still return numbers as bool, and
> non-zero will still be converted to true. Relax :)
My current practice up until now has been to use 'return false' when an
action failed, but the main return would be a number of records or
string of data. So you are now blocking that activity ... I'm reading to
right, but you are not thinking all possibilities through. But I think
I'm starting to see it broken already with the other changes to the core
:( I'm not returning 'IS_FALSE' so I'm probably going to have to change
the 'false' to '0' anyway so as to avoid the bool?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk