Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92873 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43575 invoked from network); 28 Apr 2016 17:20:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2016 17:20:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.161.169 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.161.169 mail-yw0-f169.google.com Received: from [209.85.161.169] ([209.85.161.169:34903] helo=mail-yw0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/F2-28296-05642275 for ; Thu, 28 Apr 2016 13:20:17 -0400 Received: by mail-yw0-f169.google.com with SMTP id g133so115679052ywb.2 for ; Thu, 28 Apr 2016 10:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pthreads-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Md6hwLm5uQvXjXNXXzE4ESIvO2cWfPsSVEWZMApuxSk=; b=MMbG/9G6EK6v9aiSipqWO6ctXdEYGYDOJIrmeiQmef1+/OcuQqUPeVD2fMfiJt4lN0 25qTA1zheXBoXyzrOL9A9+fLQRJ0as5JNBJ4niyKTnhJNsejnnQWpRW6qmtGxHqhRIgQ eGivqxQQnttOLfmEh4taouUMeU0HMCv951N5uxJ8y21Cwmn6gTxp/EOmLQ2n3tGJJojy 2OR++TTOzaZ/Jp/LXrdlsA0do5xo3P2AeKtZmpxIzncbBqwbXXRIUuevlaSUU8Vf0hsi 3SyGYqW0ilrUSeHUbPKt8m3xi1JjiPW5S+pFg+fB/KvsEKBWu3veyZSL45L7SHX2Mjo4 EpTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Md6hwLm5uQvXjXNXXzE4ESIvO2cWfPsSVEWZMApuxSk=; b=KolW5hj4RilEmtTz+1kwhjc/RwqeiYMt3UK+YiRWPP/mKI5tcqinzGICgSvY0EDtqQ s2K7h6bDvAGZuBmWSo41g/rggjML2pQ8SCLkcxpF3msG0z2ZILwUGDzqqJ7FBhpgrffG h/leEvSyQgKY2C8Sx6as7V9WVJO/NUK7j8uvapJVD0mTyv5VwfXQnbSd53USxaX7cCei ZqdXJA45i6olCy8C6Ohda3hzmksHzjhEyKvaGhyDq9vPKlJhtEu9LFql8PuuhO9spjQo YSP2bxLbUrxGYzNPWmnjuliF0Pm5JkxyD146mUbrOtKh5ZKrz5NNPTQUsC2eBKQGHkl9 8l8A== X-Gm-Message-State: AOPr4FUKoLeS7ieIK/LlEIT+GUzc7yIiPALk2LrzdRC1ISbeUVseQk7gw4JVHVA1aZQGiF9lbADYzNIfZpg+hA== MIME-Version: 1.0 X-Received: by 10.129.86.131 with SMTP id k125mr8416060ywb.158.1461864013176; Thu, 28 Apr 2016 10:20:13 -0700 (PDT) Received: by 10.129.109.67 with HTTP; Thu, 28 Apr 2016 10:20:12 -0700 (PDT) X-Originating-IP: [165.120.173.102] In-Reply-To: References: Date: Thu, 28 Apr 2016 18:20:12 +0100 Message-ID: To: Dmitry Stogov Cc: Levi Morrison , internals , Tom Worster Content-Type: multipart/alternative; boundary=001a1143312c3753c705318ebdf8 Subject: Re: Request to withdraw RFC's for nullable types for only return values From: pthreads@pthreads.org (Joe Watkins) --001a1143312c3753c705318ebdf8 Content-Type: text/plain; charset=UTF-8 Evening Dmitry, This was discussed at length with bob, and I think nikita also, it seemed like a bug fix rather than a feature. Happy for it to be moved into 7.1 ... sorry for dropping the ball there ... Cheers Joe On Thu, Apr 28, 2016 at 6:07 PM, Dmitry Stogov wrote: > Thanks for catching the BC break. > Fortunately, we didn't release 7.0.6 with this problem. > > I see some sense in introducing that check, but changing behaviour > requires RFC and definitely not allowed in minor versions. > > I'm not going to withdraw https://wiki.php.net/rfc/nullable_return_types > It doesn't prohibit usage of nullable for arguments, and even sets > additional question. > > Thanks. Dmitry. > > ________________________________________ > From: morrison.levi@gmail.com on behalf of Levi > Morrison > Sent: Thursday, April 28, 2016 6:40:59 PM > To: internals > Cc: Dmitry Stogov; Tom Worster > Subject: Request to withdraw RFC's for nullable types for only return > values > > I have discovered through a [bug report][1] a case where having > explicitly nullable parameters would be of value. > > > interface Foo { > public function bar(array $baz = null); > } > > class Hello implements Foo { > public function bar(array $baz = array()) {} > } > > ?> > > You can theoretically change the default value in a sub-type, but in > this case moving away from the default value of null breaks because > the subtype no longer permits null. It is important to realize that we > previously *allowed* this behavior since PHP 5.1 but was fixed in > 7.0.6. > > If instead we had nullable types separately from default values of > null this could change to: > > > class Hello implements Foo { > public function bar(array | null $baz = []) {} > } > > ?> > > (or a short-form `?array $baz = []` if short-form passes) > > This preserves the ability to be null but changes the default value. > Of course, there may be other code changes necessary to future-proof > their code but there current code would now work without having to > rewrite any method bodies (just signatures). > > In light of this I kindly request that RFCs that add nullable types > for only return values be withdrawn. So that [Union Types][2] and > [Nullable Types][3] can go forward unhindered. > > > [1]: https://bugs.php.net/bug.php?id=72119 > [2]: https://wiki.php.net/rfc/union_types > [2]: https://wiki.php.net/rfc/nullable_types > --001a1143312c3753c705318ebdf8--