Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93495 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47819 invoked from network); 25 May 2016 07:06:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2016 07:06:39 -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 157.56.110.146 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 157.56.110.146 mail-bn1on0146.outbound.protection.outlook.com Received: from [157.56.110.146] ([157.56.110.146:52972] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/03-17017-BFE45475 for ; Wed, 25 May 2016 03:06:37 -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=00DTyKdCD9x1X3Hf6mlRxhTMA9Xk1Ba7oHyUZNT2nPc=; b=HihVO2P+YSKwDXTW/O85A0VXsBEdFNmGGIvh+DgNeSDwxA/hI5LG7+ilQwwOVb177YZCATJTbnU1xJjGAG5wiVhGwgqYCxYvNGzLWyAjl7hY/kaUL47htt1Jtz9Y1+gdmlIsRdhUyfD/znmdmqcAkVVx/a9R2WNaPtYsIDHLUxQ= 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 CY1PR0201MB1785.namprd02.prod.outlook.com (10.163.55.18) with Microsoft SMTP Server (TLS) id 15.1.501.7; Wed, 25 May 2016 07:06:29 +0000 To: Joe Watkins References: CC: PHP internals , Phil Sturgeon , Bob Weinand Message-ID: Date: Wed, 25 May 2016 10:06:17 +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="------------9FE90A572C5CB54500329A48" X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: AM4PR0201CA0022.eurprd02.prod.outlook.com (10.167.253.160) To CY1PR0201MB1785.namprd02.prod.outlook.com (10.163.55.18) X-MS-Office365-Filtering-Correlation-Id: 75df69c3-f4ab-46f3-c011-08d3846b197b X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB1785;2:DeDkC0UVbdk+gVd04n2iKabdOepGTRNRCgM2ZisHtSPPa6MEhJJiSgGPa0qYxM3jiVZy4vzio0QixmnOG0mPho9gXhR2dJ1qsh7c3U1Ny7B4WSZ6EH+YcszqjKx0IeKSGdhzG6WB+R05A+3ZA0hmk/dDUxk9jZrfAXUNErll1dNqLcGcBAjDqxtM6hCWKDQX;3:cyxHrtnSv+1q829+luLRW6sxdcZrfQY1+kcnBBb92n9bGxzPny3GMTgKlMVHo3BYridNxz8sf268WLMkI8pRlmRaVdToP0af71wG3GbSgQyEmPh9KCDZJVWPFjibJGiu X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1785; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0201MB1785;25:4q2APhpGQEvYJVPv1miqHGZu17k1j0Ci6GVinSr?= =?us-ascii?Q?5ccm/qmTEj0JDegs5cYMfAfh+hDxka3rfONnqIgVBfKJnHPHxPS1xk67ihc/?= =?us-ascii?Q?Ne6GuB9bkRKiGll7Pz0kvIIyjrkZajsnSdwpK/vGGBl63KvGFdfn00Cp0rR7?= =?us-ascii?Q?nxEjGXvxr2x1XIILHjFQeyD5vZP6Js3x1gs8McNvDawxGWfFtNBvU+p5mBLh?= =?us-ascii?Q?1nXVE9o6LDhO06a2LuMW/yIdeSpw5yuF2J20bwurZUwiaiUPvRPQ5LvUxIlm?= =?us-ascii?Q?GQ1dsMVMDYYQCMnQH1vBFA01Fp9X88L9RH7P060mYzkZdf/5XyaiGcUtpQOf?= =?us-ascii?Q?4vJ5emINiyZWCVmOvBMUUhKXhYv43uPavBwVEfUt9cfqTgec0ucFq0ktmp6n?= =?us-ascii?Q?pSZa6KIMr5a9i8w8gE7ngC8PjCDA+HwS+f+J5KEom1yL8pEwPAzJ2N13RkVf?= =?us-ascii?Q?v1WMFysGrXgR/1r7hLg1T2Yol2NSI64uZ3+B3ewiDJipxGKaToQPqrrM6N9z?= =?us-ascii?Q?/ZzD+/hLtb+6b25uw2tZLULEYgEwDNPvpheBEHQaXsyc+JzVHg+tH2P4xmP/?= =?us-ascii?Q?aGUDgFdu7p19MsN8KbI36mhX4G8VUPGWqHjjTD0hx22BkLpu/86W/R+EOQIm?= =?us-ascii?Q?QDp7085kQUpcCj61px6lFywwIfkj8UakMCnn77oVsSuqU6JgB7Zh+48OJZL3?= =?us-ascii?Q?D14ICx4dwh6cl+Inf0FpFGsA1q/7dIFRD6kaYkxO0ss3EvNtDySD6asxlZ37?= =?us-ascii?Q?Sk1JyTEG2akohA61laUR45CMlKSTmjcyxpdDTm2Bo5/LLVvQUTc80zWDMV4S?= =?us-ascii?Q?ookrCsBrTLnSeyLBtbhJMPHmHkLUhnP7drjRpe7iIbUO035LxCT2yg07RH6S?= =?us-ascii?Q?DodLiv25+MxZUBOOySYi8UAzg1KLTAPbq363A4NpTNaRfaQDUIpbzsmKaTcl?= =?us-ascii?Q?aNNOtnUG0MpoOqjAA2mamCYY8fYs0j5iUJm8srx5CtA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB1785;20:OFgJ39PDpfNsVKpPC8+oEFToUQoWWkwcq4vPmSSPeIPvrXXvqgVoipfCiGGFz8l08uY8J9+s5BWByhe0Ro0okM1u4agtc45PNFHiv6BcgqjDs8vTkEEAp+uIygDGA20qXAJ4MmPonuVJdmUTv/EDNMC59TUvn+Oi/cH4avwOJ/7LFkTJunzOrwCCc0lntms+3ZP+JYPoShB7LgzwOLDaDQBqFQHkmgGyMS9m9duXQEg+ETS/hGafm9Bu1gpzPIa23BgZDlYR1UpYt3sQn/FDSV5MKwS4JgF6gRHwHL6eSJl06cSeKaewQw4onjsWIOCO5PeZ2X88BUECb/uusdLwbrxk1OgB6SNirB7w04t880g2sO7nKBoPi3f8nKqw/kglM/TDEQvem2mpBp9mxl+GF1F6eRr55LJOf8uD3gMpxBb1X9ZFLGFtAoMFU3TAKVwiOPFKDbIID9Wx8g++km0/2PWZJk9YsWLiiKVMLlY/NApvRjsPXEok1hjTRdu+OiDV;4:2JQVRPN3LlZB5Qn/mp9aRIuxr0WzJmWREqp6kK4rFJVjK5JaHcBLYDNux8FAiq4RlD66zg5PcpIoxdnyDi7y36reGC1x7oDSi/29eGRJwqz4XCUwXno7Q58pHFqt1reVus8j4Ac64hRybDs9a6rJMQrCk3KtmMzaGw7e/Ozjj2hHqtc0sVw3ahknhR22Lqf3FFnATkVMuqcWklT6QEbYGamfx4H50wNnm+WpBQbMwExQVzjj8OxsGak2ThBmNrqabnvIWM1yr7PUvqMd6aHYNjisP3u3BjXv0hH4WnjrGpoTFD3WeXu/Sfa/rOTNuTWOwo/AY6FDoUP2oU6zXnm+lJeARTJN8uknQqS2D+jB4qkeP6cTajMYQJMmzXhpNH48 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)(3002001)(10201501046);SRVR:CY1PR0201MB1785;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1785; X-Forefront-PRVS: 09538D3531 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(377454003)(52314003)(24454002)(6116002)(270700001)(2906002)(3846002)(4326007)(65956001)(66066001)(19580395003)(76176999)(64126003)(54356999)(5004730100002)(50986999)(586003)(5008740100001)(19580405001)(8676002)(16236675004)(81166006)(4001350100001)(512874002)(31686004)(15975445007)(110136002)(189998001)(92566002)(84326002)(2950100001)(83506001)(77096005)(31696002)(42186005)(19617315012)(36756003)(86362001)(33646002)(65826006);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0201MB1785;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0201MB1785;23:lfsd+r+DB+jqeP8herNmLN4vF+lyks9AINhi+vA?= =?us-ascii?Q?uYsm6BYlfxqo9+ktVpDfZaFzQt94HacUmfZP18F6JsfA+CAbX16CTdBpHIBf?= =?us-ascii?Q?wpXdrD0y0HmZrZEHgDIMJ5klHU7SeViyYzUbRJck0CjsRdkloAKqojW1CXQB?= =?us-ascii?Q?fQS0CP113vQQg0aABPH98hxt42mQ8lq6zd1nWDdDyOHrAgUGW7eRe8tMVi3O?= =?us-ascii?Q?BNFOn6oFdXewWMZYPjhijhiirt1IrI71FxizYgU2pBuzZqDytKcXfFVOlpYE?= =?us-ascii?Q?4YWN2pgY5c2kC4CKWmFZs/M+bEKHB0wxkHPE9Ypg9o/CGHSdA0+BidvDjlgU?= =?us-ascii?Q?2VjqnpaZywUsWq4muwQg6Sg95+SmwTwEF8gg6jA7ZkDPXWEbpoay6hZYbFCs?= =?us-ascii?Q?DMuk5HEglk+zvbsWYFfnP39lW0vrZnv5ylwpmoDMLtu99FakbV2r9vKzRksk?= =?us-ascii?Q?CKYIJZHeI2q9JYXc28bT1dQrNOfi2hwfhX9YZEZBOAKD9NhkrlR8ylwlmQ0F?= =?us-ascii?Q?TzMnUbUNTyUtmtzqE0xpzDdKasYV6jDcxjduY9W3rjzdHIFWznOQ7wSbmt57?= =?us-ascii?Q?YQiIfSoY6cEv1804K/7/YkzqWjCvHtdAHbdfsWKcbyAx+qoTGTlzceooMvUu?= =?us-ascii?Q?s/MrG1NFFBSiwlQG8wFup/uPv0CX7o5W5c/eqPnecgyxM3fw/55alXJA7D4c?= =?us-ascii?Q?4364HfKad1Cd5KNeBu0QDQ56IpT4ekpcDky624Q0KnYHkMIxzOBcKhkhviYh?= =?us-ascii?Q?QeHLApRX6OozK4MHKe2fphXDawsAcgfdXPRpjutvgIq375z8FAgT+v+kb6lk?= =?us-ascii?Q?Z6V9hnzEuVZSjsHt2a/MYJDn3PoGDW1cKwI31H2q720H0hycpOKFe5yLwGJ3?= =?us-ascii?Q?llL6qpC3ghbEqHLQfNtsyoHOjafbRf1vl/JdHvj72y0CYJ09RjgnOZOM/vO9?= =?us-ascii?Q?u1Aa+6+C6hWO0SdFsMMiyUCsi/26ClQnmUiVWHeMDFKOnFHqjJY2tJpYBwRq?= =?us-ascii?Q?zDVXmJl7qTw2oybyqSrIE9ScAtIPb/Ym7YnI68Urv1l7wmWQkzRAC2BztQIA?= =?us-ascii?Q?2eUKgf+h2zfxv+BQ0bE9xk4ntIHx4lulOi39zTc19EtmqinknE4zzVdID0u5?= =?us-ascii?Q?GGLtbJ3w1NOU=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0201MB1785;5:LFKv5uH3BSq17X4Qg053yvcVkgh8Ta/wVZtxJoZVbOYyaP4Pfph4s8C145GkX8Ku9gPrsZPvscrG/6RINF4TR/kJ3lhABqBZbwX1NGkHj1qjLfd2hh1iI91rvUdb112FvMzmD5GG3hHj9CCK1ZdCiA==;24:U60bKtyqUODKepEagU6AhyvtykC2tU/UUIt5MKLen01zLPDmUuepuJNolpuK9RsIKmb8vIh5broBgeOjOxTnRgWApaIUYuHgbwTFDO79HVY=;7:2hv3QDZCEMTOZjvT56HP730SnYrg15tMoUJbwiw4z/LXI5wuIk6yDpPvBaT22IRKoAXlp9rSe3O5TKzvtMDBnecDHD/wYIVliEepO2rSGFF8vOhH0s3PYbVJKDk2tUtCToXFWxOnf/rFNClBcFawqJ9IzkGFGi2Hc3ywx7z3od2f+UBAc1xxkjBWfs3bIw3E SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2016 07:06:29.4685 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1785 Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: dmitry@zend.com (Dmitry Stogov) --------------9FE90A572C5CB54500329A48 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit 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 > > --------------9FE90A572C5CB54500329A48--