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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php