Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91708 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29979 invoked from network); 16 Mar 2016 18:58:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2016 18:58:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=netmo.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=netmo.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: netmo.php@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:35210] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/5C-48430-5DCA9E65 for ; Wed, 16 Mar 2016 13:58:30 -0500 Received: by mail-lb0-f170.google.com with SMTP id bc4so54133940lbc.2 for ; Wed, 16 Mar 2016 11:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=3kBDQA/HAHgoSxUq8VbpGvTMDqc7oJJwPJ3qeKEv/KE=; b=TSh7457OtOZ4PUMSf1JnHIt44/jiKxF3JVmdPQiPIwiL6UrD/iBPxZ1tFCwZC5tmU8 hqCTuxoofrJABvhoyT7PA8rQaR11IZAUpukhUTMPLqH94WdXxTYT70/n5tOqX/3T+G1M VcxFu4SoXrA4mrMo6TM6S67aQBIWEUtHPPi5Oen1fN4hHFVLPr3ILSoyYlGnzmiY2eJ0 0j+8RK1W166VxLsk45u3JVNT5+sGZEF2kzYy9Om+FesSrwyOLoGgrmNxHLlRF7uvposi wQC8H8078VpJHDR9aoT+DIPJhrF+Ol52pzEADCsC4jOQAokTZtATsxWt6/i7HGo/g167 PJoA== 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; bh=3kBDQA/HAHgoSxUq8VbpGvTMDqc7oJJwPJ3qeKEv/KE=; b=LpS8F8TRX4ndrxH4Jcjfiv73MlX7tFUhty06qrjLmQqTO66VnjVIr6AeXla7zvHkTH KstDi4rJMSuNCE2lgbn1ehlVft4AjZrSp31Npy5H0dIrj3KaoUhKVmSwPfqoeFC2HGMV DabQQ9OX29UYMstwQ0BJsaYytLFBOzUBe26/7J94AtQ9HxSkybdfrGnbER+cwyfosUoD 2sJDnI5DGMkDEit3BEInNwDtsE0+9Vwj3IBL1zdYe8PDeS+xCDg7C31f8r4EkC+Xdz/z x6YCXF0fpxfnMkXxU35dBiqqC+cduzRrG5zvt+5V7stWeNhcsfdBjmwtc/D/YSt/Fxnk 5WPg== X-Gm-Message-State: AD7BkJLdoxMvaX1lNrlCinYL0DvcAnu9OkmdEUjzHALSEBAdz6VFCDN88J5KboS0+DKCpQ15DSZuOgnQWneFxA== MIME-Version: 1.0 X-Received: by 10.112.16.168 with SMTP id h8mr2076221lbd.90.1458154706391; Wed, 16 Mar 2016 11:58:26 -0700 (PDT) Received: by 10.114.109.70 with HTTP; Wed, 16 Mar 2016 11:58:26 -0700 (PDT) In-Reply-To: <1458153695.3969.16.camel@kuechenschabe> References: <1458149992.3969.2.camel@kuechenschabe> <1458151531.3969.8.camel@kuechenschabe> <1458153695.3969.16.camel@kuechenschabe> Date: Wed, 16 Mar 2016 19:58:26 +0100 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3acb24d5936052e2f1970 Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: netmo.php@gmail.com (Net Mo) --001a11c3acb24d5936052e2f1970 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable class SomeStruct{ public int $a; } class Joe { public SomeStruct $struct; function test1() : SomeStruct{ return new SomeStruct(); // TypeError: can't return a type whose fields' type declarations aren't fulfilled } function test2(SomeStruct $struct){ // TypeError: can't pass in a type whose fields' type declarations aren't fulfilled [*] } function test3(){ $this->struct =3D new SomeStruct(); // TypeError: can't assig= n to a typed field a type whose fields' type declarations aren't fulfilled } } (new Joe)->test2(new SomeStruct()); // [*] 2016-03-16 19:41 GMT+01:00 Johannes Schl=C3=BCter : > On Wed, 2016-03-16 at 19:15 +0100, Bob Weinand wrote: > > > > Eih, only to typed properties. Everything else would be insane ;-) > > Sorry for being imprecise. > > Ok, quite a lot better, but still weird difference to the language. > > > There's a notable amount of places where references are being used and > often users aren't aware. (Binding parameters in database queries, in > order to support OUT parameters, comes to mind, many array functions > take an array, some functions use it to report error codes, ...) > > I guess this will be a famous support issue. > > And yeah, I'd love to "fix" all those places and get rid of the > references, but BC ... it's quite massive :-) > > > johannes > --001a11c3acb24d5936052e2f1970--