Re: Coercive STH - some real world tests and updated RFC
| From: | Lester Caine | Date: | Sat, 28 Feb 2015 09:24:11 +0000 |
| Subject: | Re: Coercive STH - some real world tests and updated RFC | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84077@lists.php.net to get a copy of this message | ||
On 28/02/15 08:40, François Laupretre wrote:
> My opinion, but that's only mine, is that I would favor deprecating null to scalar, even
> for internal functions. It would add deprecation messages but we'd end up with a cleaner code.
null is a very specific 'state' for anybody working with databases. It
means that no value was found. Mapping that to a default value for
future processing is a job for the application rather than the data
packet as returned. It ONLY needs to overridden from a default "" or 0
in cases where the simple default is not required, but on the whole the
default 'case' is ALL that is needed. That null is also false in
situations where a bool is required is also natural. It's now having to
go through all the code and manually add these quite natural casts which
is the problem here. It's not a bug or mistake, it just flows in the
whole process.
--
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