Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92879 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53849 invoked from network); 28 Apr 2016 17:41:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2016 17:41:38 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.161.179 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.161.179 mail-yw0-f179.google.com Received: from [209.85.161.179] ([209.85.161.179:33266] helo=mail-yw0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/45-28296-15B42275 for ; Thu, 28 Apr 2016 13:41:37 -0400 Received: by mail-yw0-f179.google.com with SMTP id t10so133012887ywa.0 for ; Thu, 28 Apr 2016 10:41:37 -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=BCv4MYWI7Z8ftFj6D3xreqMARcxA7GGawA+mAxZBzss=; b=eAuFRrZWUwGxpDsKsk8QkT5Fx2Y/pX9Q00hUQygzG78qMABmb8noPkAEkYFjCgnigY VmcIDI7Y4DWVY57tOSYVMBvEyqgEH5xzJK4MTdLA0rCRrYXRhRYr7G3cYoG7D5ftmBp+ 4v1uPzU8tUh+yriPknQVvwlvCCkDELlMbs6S65jiWiXdnmoBWTXH5EuIhG4Frmo4JqR5 sUxD1u/HYDFGVBydsZqncZYdzGe1Gs5l5N3xXV5E2dn09C5H4cp6RCW/SvQgQ/47yeQa C/+3/JMxvR039oYgK+sVbWEsbEw/I01u+KWUF8jJSp2nIu3VP6MCUiG6WpTBAOztTsoK 5f/w== 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=BCv4MYWI7Z8ftFj6D3xreqMARcxA7GGawA+mAxZBzss=; b=IflXFPqn0+gspzXt6RV4F40J8WhYyB49MTXG4jZM9Mk4fyzk+3fssiLw+cQbdfaIPI NdoKM/8NVrfhJnL0UqlIoRhAIpL11m7Qs6FdfC8KE0XRhmG3spDbSdo+hC38sh7PRHT2 hL68W6YYfdqN7CczSMnGZxreEW1g2U9bUxnGkhtGXIOg0VRkbnlIUgTZVjjmMLPvbFBT MoNHtcPNGId6O2/0pw00qqZyZXfmt0UJOyeKejkwboaKoLtFmYKCU5eFliIILvppt6Dt 0flvgFx7geVmEkrDPIrPKwyN/clBB8KsIy9UX4V/AMNJavlHgJut8ERpVRZClj1jYhRO 4PGQ== X-Gm-Message-State: AOPr4FWL9YMzM8wrdoGFXhtl1hA9KAUiA+zosrc4Uh5ZZs2CVDo0Ezz4wL6LqgFeuCvcAavi4FT5WSb3QY4LZw== MIME-Version: 1.0 X-Received: by 10.129.44.139 with SMTP id s133mr10341570yws.182.1461865294886; Thu, 28 Apr 2016 10:41:34 -0700 (PDT) Received: by 10.129.109.67 with HTTP; Thu, 28 Apr 2016 10:41:34 -0700 (PDT) X-Originating-IP: [165.120.173.102] In-Reply-To: References: Date: Thu, 28 Apr 2016 18:41:34 +0100 Message-ID: To: Bob Weinand Cc: Dmitry Stogov , Anatol Belski , internals , Levi Morrison Content-Type: multipart/alternative; boundary=001a1141e82a9caca405318f09c4 Subject: Re: [PHP-DEV] Request to withdraw RFC's for nullable types for only return values From: pthreads@pthreads.org (Joe Watkins) --001a1141e82a9caca405318f09c4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The problem is as Levi explained though Bob, don't we actually require nullables/unions for that case ? Maybe we can move forward now, confident that by the time 7.1 is released we will have one of those things ? The problems with that are, the RFC's for unions/intersections don't match the implementation, and none of us have a good idea how to implement the RFCs. In addition, nobody can agree which nullable types RFC should go to vote, or how the whole nullable type question should be resolved. Cheers Joe On Thu, Apr 28, 2016 at 6:36 PM, Bob Weinand wrote: > > > Am 28.04.2016 um 18:28 schrieb Dmitry Stogov : > > > > Hi, > > > > The BC break in PHP-7.0 was introduced by commit > ee9a78a033696ff9546fb1dbfecd28f20477b511 > > > > Author: Joe Watkins > > Date: Mon Mar 28 11:54:25 2016 +0100 > > > > Late, there were few more commits that changed and moved the problemati= c > code. > > > > Anatol, I think we should revert this before 7.0.6 release. > > > > Thanks. Dmitry. > > > > ________________________________________ > > From: morrison.levi@gmail.com on behalf of > Levi Morrison > > Sent: Thursday, April 28, 2016 18:40 > > 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 =3D null); > > } > > > > class Hello implements Foo { > > public function bar(array $baz =3D 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 =3D []) {} > > } > > > > ?> > > > > (or a short-form `?array $baz =3D []` 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=3D72119 > > [2]: https://wiki.php.net/rfc/union_types > > [2]: https://wiki.php.net/rfc/nullable_types > > Hey Dmitry, > > thanks for reverting=E2=80=A6 but > > I've seen you had merged just straight up? > I assume this was unintentional (as it should definitely remain fixed in > 7.1). > Thus I've reverted your changes in master (only) and added an appropriate > NEWS entry there. > > Thanks, > Bob --001a1141e82a9caca405318f09c4--