Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92872 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41016 invoked from network); 28 Apr 2016 17:07:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Apr 2016 17:07:16 -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 65.55.169.107 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 65.55.169.107 mail-bl2on0107.outbound.protection.outlook.com Received: from [65.55.169.107] ([65.55.169.107:54352] helo=na01-bl2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/62-28296-14342275 for ; Thu, 28 Apr 2016 13:07:15 -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=WeilyxA2/7twAj5asYbq1hkrFYx4m/yil9FAJsim0q8=; b=uXAKgWS4ggTtMNWPNtBRo5fhSF33SyDIbje99+YKfni1KOASIP1cZq8iZhKxntAzwqtKAdnC0f74a4ILPQeT1xC3kql4Asvi6yc5pVBjsb7Njvr0FePtp6LMlDkR47VLzD3ria0oETqet27+MqRKjME6RJoqlzs4Ln+h02r77ok= 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:07:10 +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:07:10 +0000 To: Levi Morrison , internals , "Joe Watkins" CC: Tom Worster Thread-Topic: Request to withdraw RFC's for nullable types for only return values Thread-Index: AQHRoWRe782dRDYm1kuNWD0UZVTnlZ+fm7+p Date: Thu, 28 Apr 2016 17:07:10 +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: php.net; dkim=none (message not signed) header.d=none;php.net; dmarc=none action=none header.from=zend.com; x-originating-ip: [92.62.57.172] x-ms-office365-filtering-correlation-id: 8dff4331-012f-4cc8-0331-08d36f878953 x-microsoft-exchange-diagnostics: 1;BY2PR0201MB1783;5:SXove0AEb2MneZ7Qo55cYZ6OJ2EuPpTLXCXZxVNR9YUWMEw5Nbd4uOIx1yIaMF83PV8l0ErHYOTVhjryXjafmFx+Op67nHEBfkDa1orBzbLX24YczP5Pwa87GXhW7p2KNdF9ekH7uRQVitBosBQzhA==;24:8PgUE8weWpHLVTR/Puc5+vcxdTz4Ep82ILkHkx87i4iRgb48WrD0a5mBRLcusYWqFfET08Tn/Evc7AF8MNiAGh8k2tUYdqMsHCwQ4zvRiB0=;7:SMAuhd/DdkRaM/GgWUq7gbo20UYSrZSfscaBBTjpwxQP/D2ZhSKrhRQ/GaowirB9OMLbHlNs0+WZF9w32OTNynptTPdMQ9L6+pjEqe+zk3mDMArcQas8V2qmGFrs+RiVTLhrGlS0viNO+4ViGcni4vb2q5hCKE0ukLQxjMf3Z/IBjugBOA7scbGAPbo+v1HN 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)(5001770100001)(2900100001)(76176999)(54356999)(5003600100002)(5002640100001)(2950100001)(16799955002)(189998001)(9686002)(3280700002)(19580405001)(11100500001)(1096002)(1220700001)(3660700001)(81166005)(19580395003)(122556002)(66066001)(92566002)(5008740100001)(99286002)(106116001)(102836003)(3846002)(2906002)(586003)(6116002)(86362001)(74316001)(87936001)(5004730100002)(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="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2016 17:07:10.4090 (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: Request to withdraw RFC's for nullable types for only return values From: dmitry@zend.com (Dmitry Stogov) 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 addition= al question. Thanks. Dmitry. ________________________________________ From: morrison.levi@gmail.com on behalf of Levi M= orrison 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 value= s I have discovered through a [bug report][1] a case where having explicitly nullable parameters would be of value. 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: (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