Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92887 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66951 invoked from network); 28 Apr 2016 17:59:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2016 17:59:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 157.56.111.133 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 157.56.111.133 mail-bn1bon0133.outbound.protection.outlook.com Received: from [157.56.111.133] ([157.56.111.133:27898] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/48-28296-A6F42275 for ; Thu, 28 Apr 2016 13:59:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OIdAQVaA5y8+r0r3QDZZfndSMDFR6EDc8z4mXvACkts=; b=eMzCRoyQCRs4cYenZ1sR8B+aF/GmoOrJLDrGTqy+KPyRgigt6LnyIxhT5yUet0GUJVeKeB0kpKlkvSH+Yjcu/VjJZ0MOjRnuiKLMdlWictKkOYceeZ0odwBnx0IGlu4Ytu9L/uevq9UGmp7k+/2H7RoVvww8EHvbamJuRzyDcB4= Received: from BY2PR0201MB1784.namprd02.prod.outlook.com (10.163.72.26) by BY2PR0201MB1783.namprd02.prod.outlook.com (10.163.72.25) with Microsoft SMTP Server (TLS) id 15.1.477.8; Thu, 28 Apr 2016 17:59:02 +0000 Received: from BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) by BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) with mapi id 15.01.0477.012; Thu, 28 Apr 2016 17:59:02 +0000 To: Bob Weinand CC: Anatol Belski , Joe Watkins , internals , Levi Morrison Thread-Topic: [PHP-DEV] Request to withdraw RFC's for nullable types for only return values Thread-Index: AQHRoWRe782dRDYm1kuNWD0UZVTnlZ+fkd6TgAAUTgCAAAVaWg== Date: Thu, 28 Apr 2016 17:59:02 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: hotmail.com; dkim=none (message not signed) header.d=none;hotmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [92.62.57.172] x-ms-office365-filtering-correlation-id: 0391191e-96a9-439c-434c-08d36f8ec85b x-microsoft-exchange-diagnostics: 1;BY2PR0201MB1783;5:ylyYx0aO0A8ymLVxQFiLaTxw9zgVrJJa7jHTteIs7A6YddgdQ/KxWD9DCgZrUPMhukYdbYS/DA/IGwcHIS3X+STQvD5oMYMD/Odgb2mbjLE447W/C5YZlNzvFMm65C+3oV449BnqCKmgzkXqM9vOPQ==;24:A38pivnE1SKDk1UjFYvk4klIXKQVa8OXQd38sZrAp41zRpUc/ryMmj4JKexzO4h7NhFUDZEV2uKB9yNbQ/HkqITodG3A5a4fGHivbKXOfUc=;7:fFSYwS+/t8EYTMccVHRYylSn8GqcYDjQhJO7GmY7yKu0vBJ7vS04Ye82oUzPWeTbQdr6IRF63rXkWO9Q4DG/5IHmwTaLw8niYPJjJiuP39rbpGCQGucQEYIAWywvAL4VYw5yLg+iCqKwABmQ9U72kcJFw7goVXrcL7KOtw3J4v8pl2s6xx98QTVess8OrH8N x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1783; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:BY2PR0201MB1783;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1783; x-forefront-prvs: 0926B0E013 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(50986999)(4326007)(15975445007)(76576001)(10400500002)(77096005)(2900100001)(76176999)(5003600100002)(54356999)(5002640100001)(2950100001)(16799955002)(3900700001)(110136002)(189998001)(9686002)(3280700002)(19580405001)(11100500001)(1096002)(1220700001)(3660700001)(81166005)(19580395003)(122556002)(66066001)(5008740100001)(92566002)(99286002)(106116001)(102836003)(3846002)(2906002)(586003)(74316001)(87936001)(5004730100002)(86362001)(6116002)(33656002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0201MB1783;H:BY2PR0201MB1784.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2016 17:59:02.5272 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1783 Subject: Re: [PHP-DEV] Request to withdraw RFC's for nullable types for only return values From: dmitry@zend.com (Dmitry Stogov) This is a "fix", that introduces BC break. Even if I see a reason in this check, it's still a break. If you remember, we voted for almost for every BC break during PHP-7.0 deve= lopment. ________________________________________ From: Bob Weinand Sent: Thursday, April 28, 2016 8:36:22 PM To: Dmitry Stogov Cc: Anatol Belski; Joe Watkins; internals; Levi Morrison Subject: Re: [PHP-DEV] Request to withdraw RFC's for nullable types for onl= y return values > Am 28.04.2016 um 18:28 schrieb Dmitry Stogov : > > Hi, > > The BC break in PHP-7.0 was introduced by commit ee9a78a033696ff9546fb1db= fecd28f20477b511 > > Author: Joe Watkins > Date: Mon Mar 28 11:54:25 2016 +0100 > > Late, there were few more commits that changed and moved the problematic = 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 val= ues > > 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=85 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 N= EWS entry there. Thanks, Bob