Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93497 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53593 invoked from network); 25 May 2016 08:37:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2016 08:37:15 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.112 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.112 mail-by2on0112.outbound.protection.outlook.com Received: from [207.46.100.112] ([207.46.100.112:4224] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/D3-17017-93465475 for ; Wed, 25 May 2016 04:37:14 -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=NN4pi+9OG5wK42l3x8OXMfmNt6zvBRPQtbTRLCaZzj4=; b=NnuX+Gxpx3fFk1v1yH22BUxrlcTD2qP3NyK+yiXbxLStdFaNiOTF3IjtOaJ9nxsR5tibbojjAfPBSzLSzLjFGCivzpmV7fDl8IboHZAWz6CqtDHmi7TCjUEXaYsdQWN7WzspTrZWwcunuR8vTdYkN9H2x5S1ZmeTZi5i2btiljw= Authentication-Results: php.net; dkim=none (message not signed) header.d=none;php.net; dmarc=none action=none header.from=zend.com; Received: from tpl2.home (92.62.57.172) by BLUPR0201MB1777.namprd02.prod.outlook.com (10.162.239.11) with Microsoft SMTP Server (TLS) id 15.1.497.12; Wed, 25 May 2016 08:37:08 +0000 To: Joe Watkins References: CC: PHP internals , Phil Sturgeon , Bob Weinand Message-ID: <26b6c4c1-5af0-b2f1-f308-1b6dc973cf3a@zend.com> Date: Wed, 25 May 2016 11:36:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------3A10D25AB6869E6183E5CAE0" X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: HE1PR0201CA0041.eurprd02.prod.outlook.com (10.165.229.51) To BLUPR0201MB1777.namprd02.prod.outlook.com (10.162.239.11) X-MS-Office365-Filtering-Correlation-Id: 3b98506a-cae2-4bf5-ee2e-08d38477c30c X-Microsoft-Exchange-Diagnostics: 1;BLUPR0201MB1777;2:19gZWO8OrOD/PdHMcWc/zor0UHwIX5Lqc/4IqgtYoL8nI3cPRkXn/wj+sCwMja7J7hmt1bLQ4bqiIYcw8IMvUnI/zqoCczZ/DncazlPt7qLsp1iksIB4L8su+D5Uj3tbtDRKoyVExeZme0DXIST6SoPsBJd6xgGaMGUYIbusQNsE+zcJKFzzC4rTWNSdNQLa;3:3iHOllO1y2VpH/Nlzxi3x0NR7nHTBhfU7k4s+yErXhvIC+SowCkFlN2WRfsuTknaIOmF2ML9Shb2S0W18VHM1yi7kIy+L0nB0/hfeQeqiCb1W7ymIzuZEVW6o4Y9al4x;25:Ci8oU44wmWxdu7WvAhYXEH8Re+JNtBRV1bgW6ZmkDhGx0blNfIP1uqwGkrbz2gIqrf7ds8SqeyEmdU3PR9Grltfh47Sgiavby20F8PPo6bwfSdQY9xKSiu0doKJnxoTBY51uSJdJaDUZHcdbpAyFzzWr1nLzFoEoZ8kQrpRBut33a3XbyteKR3IPrHEjZfeaQtU0ZfpTJgnP2qblGfpxjWoOrESZabK1aLa0/+Arotj06mr8QPVchEHOZlgcnK4SeELFXJKmYLsimQzYDho+GYWNQvMLXzO6s+rZ7KOKux3X/F/ZQLdBLkyWiD5YhcnKPsEUTqwA+alfOMcEQa1aGdda/F3gMVOup64Ccyp518pYr9i24BC2MLGLrpCD6KR8fqeWTHW1lC/YAXF22DoIWMJcLGYXPWJ1prXHfcuFKOQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0201MB1777; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0201MB1777;20:Nk1HXynBjFLFoQ16pMeT/md6aPVhOJnmmC6NFWPRbk3XlVC/s+XGIj17GPlwFfjVTDWwCBcpPoUy8ycyA/+TdzxktiZyj+cfM+lbCccI53BfXJuKod7Pai218USw8Ymh/gxCMNCsZugj73hsWV7wuwCndzaFpWbzWA425qTQALodM827N6VvDW+vf4PDdlF5uqbM1ahzvyJLNO3/RQJyAsxislhx1ZcwQmYdzXtcHP4jftp7jywlL15EHhIHGDpuDulkgjZH61x5mWy6GTkCsvNawlXhHzulh2VstcdawpZR3Y5kQ6ZJ9La6eL52M5B5hItBB2dWJpu4raB5kIMUN+rHOONh21QfesoT+i2YcYIMrt9dIV+ysCVQ2gd20+ihYpR/V0oxmDDhxDvhwjQ2cAgfqvsPiJeV85uoxW3pMuI9uTa9qRSMx4KsvitsJyzQ+4XpjCpTYFd5OwL2NBChbOpW2+Apqg/YnI9xZsIPYwWsxA5EhT2/6DyMUo/76ZsV;4:11OJv6j1saZM0OBUjg0IZXQc/GwVELvIhNuXhahUZkQQRNFd0F0Zcj2IMA5qSV3jMDVT2UcIFoUwNPGOZRJuo9mqsoyxOJCQFTrlu+Rklxh4bPwECcd2dpG1EMOgGjyrio9tUZIKwfTXe6iIUeUYBMSjarSdywxr/vVr8cWjm50gmGN2b7HUY1k4o9/lLo1Nikh90kjgyZ9L12EEKHKhikH6jkt4cp6G7Gu7bYCoakuKv601vKqvPHB4X9gDkyjOwge+2AFPnMggfkygSuZyiVhHzL5eX15HpXEEso+nah0JS5HxF7F4YU8dDwCVrBSttZKZClDFBXdPBPIcHLNruheIsB9kCuNYaw8Zcok2mt6GRDOxj7JMQoBSFVWmKuTD X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:BLUPR0201MB1777;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0201MB1777; X-Forefront-PRVS: 09538D3531 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(52314003)(24454002)(377454003)(81166006)(2950100001)(33646002)(19617315012)(83506001)(8676002)(77096005)(84326002)(31696002)(15975445007)(110136002)(19580395003)(93886004)(19580405001)(92566002)(5004730100002)(86362001)(4326007)(512874002)(31686004)(76176999)(54356999)(42186005)(16236675004)(50986999)(4001350100001)(5008740100001)(586003)(2906002)(64126003)(66066001)(36756003)(6116002)(189998001)(65956001)(270700001)(3846002)(65826006);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0201MB1777;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0201MB1777;23:uX3uTFIP770SYmZPCmCY7zOpyD3X8HaMLbzwATw?= =?us-ascii?Q?+YItZ+Bwj/d8Uxa+ErrmtxcY4iHLlZ1U7oM6khMZ1pegjDr3stMB0u4MRLH+?= =?us-ascii?Q?gOVWNl+0UMpAdYv7M7KulDkBGt7go/O30NHNAai0YN2HZcRTz+mIILd+xhyu?= =?us-ascii?Q?SGk9Eo57sCgjN6/EamewhdR+0P4BYya6mW9LC+CZD0Oyd4PkArmH3Fhbh5U8?= =?us-ascii?Q?t3TsYY9wxfMOhXG8FjRncc1nmnWK68UIbQZWMjOum7bdNdtG2oxzwKOIqRar?= =?us-ascii?Q?OLguEaZy4ohVKKCF97IioHb/KBzsQFbRFo6r4xk4kJHy9EYoEqSkadbcarEC?= =?us-ascii?Q?YbjuFnGZ6NmVTDVNHK8zbrsUv/JSA/pXhcm/kNxJuEuCYEFzJ5eShl8YBxdl?= =?us-ascii?Q?ycL6xY3jkcn24kvqY2DLXSi3ir3QHP2LvuirNTHrIADJdoah3oEJg1K22zg/?= =?us-ascii?Q?hFfNug1HXN0+KItnyYjtZkP5UdHoAwe7PJOecP/zcuKM9Fx1gKtQQBjcJcGg?= =?us-ascii?Q?Z0rexHrbJx4Yy/5MiSwevT/Y4R9vNr/rft9GI+NvYP5Tm6QAM1umKxfCmnnt?= =?us-ascii?Q?Wafd5S4ahLqVzgJCF4b8vg0Q6OomUht3GNv5GV6WCDPMpMbApfIDdnuo8kaF?= =?us-ascii?Q?E2kufhdykvKk33P0kZ0hGu6cFETSiFoOr22+sVxGliXaMgRLgQigcTDFqKqO?= =?us-ascii?Q?u/pO04YGYVV+kfsehjF1W/7QhenB+H0PON6P/S/Sz/OEdyNqwQ/rZVIVCYfU?= =?us-ascii?Q?OUOvBgV8p0ELQGyFrBiYoDkDDDWPDtpcV+IMWo6yLOgeT90JrbvmMy15agLf?= =?us-ascii?Q?U7o+HdELsPAcDktCSlqEbjh+1FpqmCyUjVi6GOY1xprW0To/pdUG2apYOkCI?= =?us-ascii?Q?NkjZwz+DzDSt7xESYUM+gVh7Kc3yGMGDG5fsldEqClYhqTo+VeczhUxofUBR?= =?us-ascii?Q?2DVYW2sHRBD5Q3vMULiwcGoVT8LrtJW0okON3x0EJ6FtC31Yc3fuf9tmyPRC?= =?us-ascii?Q?wKqKd1JNcWkPazzZKjQzkdu9FVeP5kwUdacug1UFzSsO111gt8NnmM89c4/I?= =?us-ascii?Q?ApIYA54veZzitQeZr3n6FcHEC28fXpW8u4N1e9vanCj5jz4VX2HhjNAiJpTo?= =?us-ascii?Q?dr0A+gvdqj29004x5I0oTULfb6Nyv3/by?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0201MB1777;5:fOBCcJvTt8wioGYCmNp7P79ofNbS+yoKxTuRRS6l2FQ4JW8ipfIXSIyYFBPzT0Vzwx3F19eeR2f4nrhh81sPZOgt7FHrtVDZMke8i4SiXllXv2vYDLNhmoGhu3XoRkz+JexYeZ6pMeqMpfj7jCjjwQ==;24://27gWnA28vnRn1rBCA2bybUrri8npUeeM1cZlYjKW4qxHZMfZ84RLh9bX7s3wLBs08OHbB97gnvtrZT4bwq4s1sbFOBNa5vyKCNfXTIM/g=;7:/sTLK6VmXYmBe27VOgceqLUmyWjYgFA47JImLNp1LpD2KJ2C6Dr1iZibTpj9jqX0gsC4CHsW700oTmKBJX5EAbK4VLRk6IfGqKAJP5DqsPaVQAHJ25Uik0z5tdHY8VKalWYtvcvphuFbvudMBes1Yv5eZYGIoHFxll4H0rg33CCquk2MKrgplvsafv3h3zZD SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2016 08:37:08.5250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0201MB1777 Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: dmitry@zend.com (Dmitry Stogov) --------------3A10D25AB6869E6183E5CAE0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit On 05/25/2016 11:30 AM, Joe Watkins wrote: > Morning Dmitry, > > > I made this check(s) to be invariant. You may like to do this > differently... > > I think this is what everyone expects, isn't it ? > > I did omit to mention that part ... > > > RFC doesn't define how uninitialized nullable typed properties > should behave. > > It does: > > > *Nullable typed properties will not raise an exception when > accessed before initialization.* > > It's the only bold text in the document :) > > It seems correct to me; We raise uninitialized exceptions to > prohibit the return of null to user land, for nullable properties we > don't need to do that. > > It does mean that ?int $foo; has an implicit default value of null, > but I can't see anything wrong with that, for a nullable property. OK. This is the same that I like. I'll change implementation accordingly. But what should unset() do? Currently it makes property uninitialized and then it can't accessed. I suppose it should emit notice and return NULL. I'll change this as well (in an hour). Thanks. Dmitry. > > I'm open to being persuaded that is wrong. > > I will review comments and current patch this morning ... > > Cheers > Joe > > On Wed, May 25, 2016 at 8:06 AM, Dmitry Stogov > wrote: > > > > On 05/25/2016 09:06 AM, Joe Watkins wrote: >> Morning Dmitry, >> >> There's no section for nullables, but there is mention of >> them, specifically in relation to your query: >> >> > While parameters allow null to be accepted as the default >> value, null is only a valid value for nullable properties. >> >> Is there something wrong with that rule ? > > It's OK. This just should be defined and it's defined in RFC (I > missed) >> >> Having explicit nullability means the declaration tells you >> all you need to know, all the time. >> >> Being able to set null any typed property means you can never >> be sure of the type; You can't tell by looking at the declaration >> what type the variable will be because anything is allowed to set >> it null. >> >> We waited for explicit nullability to avoid this. >> >> You'll have to have a really good reason for me to change that >> rule :) >> >> > Inheritance rules for typed nullable properties are also missed. >> >> That's true, but shouldn't they use the same rules as nullable >> parameters, will discussion change how they should work ? > I made this check(s) to be invariant. You may like to do this > differently... > It's better to define this in RFC, check implementation and add > tests. > >> >> > but still have unsolved problems. >> >> If you have discussed these somewhere, can you send/show the >> transcript ? (I missed all comms after yesterday morning, due to >> illness). > > We are working with Bob, trying to improve the patch. I added new > tests fixing the problems, and also added few comments o github. >> >> If it emerges that the RFC needs to be modified heavily, then >> I'm happy to stop the voting. > > RFC doesn't define how uninitialized nullable typed properties > should behave. > > class C { > public $a; > public int $b; > public ?int $c; > } > $obj = new C; > var_dump($obj->a); // NULL > var_dump($obj->b); // throw Error("") > var_dump($obj->c); // first or second??? (currently throw Error("")). > $obj->$a = null; > $obj->$b = null; // throw Error("") > $obj->$c = null; > var_dump($obj->a); // NULL > var_dump($obj->b); // throw Error("") > var_dump($obj->c); // NULL > unset($obj->$a); > unset($obj->$b); > unset($obj->$c); > var_dump($obj->a); // notice + NULL > var_dump($obj->b); // throw Error("") > var_dump($obj->c); // first or second??? (currently throw Error("")). > > This should be defined. > >> >> >> But, so far, we haven't actually deviated from the RFC, only >> changed implementation details that are not part of the design of >> the feature. > > I'm not so sure. > Anyway, I hope you are better and we will able to speak today or > tomorrow. > > Thanks. Dmitry. > > >> >> Sorry if it seems like I'm missing information, I don't know >> what you and Bob found out yet ... >> >> I super appreciate you guys working on it, obviously. Thanks >> for that :) >> >> Cheers >> Joe >> >> On Tue, May 24, 2016 at 8:04 PM, Dmitry Stogov > > wrote: >> >> Hi Joe, >> >> I've add implementation for nullable typed properties (as >> they fit into the patch design), but RFC missed any >> description of nullable properties. >> See tests >> Zend/tests/type_declarations/typed_properties_047.phpt, >> Zend/tests/type_declarations/typed_properties_048.phpt, >> Zend/tests/type_declarations/typed_properties_049.phpt >> >> I'm not sure, if this is what the voters expect. At least I >> don't like the facts that "?int $foo;" declares uninitialized >> property; "?int $foo = NULL" may be unset() and became >> uninitialized; and it's an open question if "int $foo = >> NULL;" should be supported as nullable. Inheritance rules for >> typed nullable properties are also missed. >> >> Personally, I think the RFC was moved into voting state too >> early (without good enough implementation, and with missing >> topics). >> The current implementation is better (performance penalty >> reduced to ~2%), but still have unsolved problems. >> >> May be it's better to cancel voting, solve problems, finish >> the implementation and add missing questions into RFC... >> I'm going to help with implementation in any case, but we >> should agree on what we are doing. >> >> Thanks. Dmitry. >> >> ________________________________________ >> From: Joe Watkins > > >> Sent: Friday, May 20, 2016 9:05:34 AM >> To: PHP internals; Phil Sturgeon >> Subject: [PHP-DEV] [RFC][Vote] Typed Properties >> >> Morning internals, >> >> Since we have our answer on nullable types, typed >> properties can now go >> to vote. >> >> https://wiki.php.net/rfc/typed-properties#vote >> >> Note that, support for nullability as RFC'd will be >> merged when the >> implementation for nullable_types is merged into master. >> >> Please participate. >> >> Cheers >> Joe >> >> > > --------------3A10D25AB6869E6183E5CAE0--