Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93292 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17197 invoked from network); 12 May 2016 19:47:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2016 19:47:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=mathieu@texthtml.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mathieu@texthtml.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain texthtml.net does not designate 62.210.206.189 as permitted sender) X-PHP-List-Original-Sender: mathieu@texthtml.net X-Host-Fingerprint: 62.210.206.189 texthtml.net Received: from [62.210.206.189] ([62.210.206.189:35339] helo=texthtml.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/46-28272-6EDD4375 for ; Thu, 12 May 2016 15:47:51 -0400 Received: by texthtml.net (Postfix, from userid 65534) id EDB48251; Thu, 12 May 2016 19:47:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on b7ba30992c3e X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE autolearn=ham autolearn_force=no version=3.4.1 Received: from [192.168.1.18] (stunnel_mail_1.mail_default [172.27.0.8]) (Authenticated sender: mathieu@texthtml.net) by texthtml.net (Postfix) with ESMTPA id 36C5B24F; Thu, 12 May 2016 19:47:45 +0000 (UTC) To: Lester Caine , internals@lists.php.net References: <573232DB.8030209@lsces.co.uk> <573308EC.70502@lsces.co.uk> <57346ABE.1070509@lsces.co.uk> <57346DFB.5020909@lsces.co.uk> Message-ID: <9f4cfeac-00e8-5d8d-9c09-0180a6e86a46@texthtml.net> Date: Thu, 12 May 2016 21:47:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Thunderbird/47.0a2 MIME-Version: 1.0 In-Reply-To: <57346DFB.5020909@lsces.co.uk> Content-Type: multipart/alternative; boundary="------------1DC548155C412F09C0BFDD8E" Subject: Re: [PHP-DEV] Re: [RFC][VOTE] Nullable Types From: mathieu@texthtml.net (Mathieu Rochette) --------------1DC548155C412F09C0BFDD8E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/12/2016 01:50 PM, Lester Caine wrote: > On 12/05/16 12:39, Michael Wallner wrote: >> On 12/05/16 13:36, Lester Caine wrote: >>>> On 12/05/16 11:21, Davey Shafik wrote: >>>>>> E.g. the behavior of passing executing with a null value for the >>>>>> argument is something you should be consciously making a decision on, >>>>>> and passing in null explicitly. >>>> I was actually getting the logic wrong... the problem with this proposal >>>> is that I HAVE to add the '?' for many of my libraries to continue to >>>> work simply because they do handle the null case. So what was a working >>>> system is broken by this change. >>>> >> So you already have function foo(Foo $foo = null)? >> No need to change anything. > To be honest I don't know ... *I* would not necessarily add '= null' > because that is the default case anyway ... I'm not sure fromthis > 'little change' just what the full knock on effect is to code that goes > back 15 years? you don't need to add '= null' or '?' anywhere. function that already accepts null arguments (either because it's untyped or because there is '= null') will continue to accept without any changes adding '?' will make the function more permissive. not adding it will not make any existing function more restrictive > -- Mathieu Rochette --------------1DC548155C412F09C0BFDD8E--