Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94752 invoked from network); 15 Mar 2015 22:33:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2015 22:33:47 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:35667] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/64-06614-9C806055 for ; Sun, 15 Mar 2015 17:33:46 -0500 Received: (qmail 6545 invoked by uid 89); 15 Mar 2015 22:33:42 -0000 Received: by simscan 1.3.1 ppid: 6538, pid: 6541, t: 0.0730s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.178.189.108) by mail4.serversure.net with ESMTPA; 15 Mar 2015 22:33:42 -0000 Message-ID: <550608C6.4090709@lsces.co.uk> Date: Sun, 15 Mar 2015 22:33:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <325E0097-FD7E-4997-A95D-20C62368E162@zend.com> <55031C54.6060802@eliw.com> <7CE491F0-C243-4788-ADA2-5DA9DF1D1168@php.net> <332304ae552bfc635f999a8d73b505f0@mail.gmail.com> <85d81405ee1791efadea83cf734ebce3@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Basic Scalar Types From: lester@lsces.co.uk (Lester Caine) On 15/03/15 18:16, Niklas Keller wrote: >> I think allowing `null` for an `int` is an error. Converting a null to >> > zero on a type boundary is harmful in my opinion. > I agree, `null` shouldn't be allowed for `int`. That a database result set will have perfectly valid 'null' returns for fields is perfectly normal practice. Even if with a full record those fields would have numeric counts of say invoices for a period. Treating the field as a '0' may be valid in some cases, but equally handling a null return is valid. While off topic here, very closely related is returning a 'null' object when there are no return values. Now converting that to an exception is simply wrong from a normal data flow process. null has a specific function and value. -- 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