Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93224 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30162 invoked from network); 11 May 2016 10:26:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 10:26:56 -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:52344] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/17-28272-FE803375 for ; Wed, 11 May 2016 06:26:56 -0400 Received: (qmail 31033 invoked by uid 89); 11 May 2016 10:26:53 -0000 Received: by simscan 1.3.1 ppid: 31025, pid: 31028, t: 0.1299s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 11 May 2016 10:26:53 -0000 To: internals References: <573232DB.8030209@lsces.co.uk> Message-ID: <573308EC.70502@lsces.co.uk> Date: Wed, 11 May 2016 11:26:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC][VOTE] Nullable Types From: lester@lsces.co.uk (Lester Caine) On 10/05/16 21:26, Levi Morrison wrote: > It can affect the results. > > function foo(?Foo $param) {} > > If any code out there is calling foo with null then that code will now > break if you remove the question mark. Cart before Horse comes to mind ... If the function is going to fail if you pass in a null ... you check for the null before calling it. OK the '?' is a flag that you need to do that, but you really need proper documentation as to just what Foo expects. If I've handled the null case situation, the ? is redundant? I'm still failing to see an overall picture of what people are trying to achieve. Adding errors means that those errors need to be handled. If the function gets a 'null' then there is a reason, and either the function should not have been called ... workflow failed ... or the function should simply handle the 'null' case. If the '?' throws an error the workflow is broken after the event where a user code warning would be more helpful. -- 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