Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12645 invoked from network); 21 Mar 2016 15:39:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Mar 2016 15:39:49 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wm0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:38120] helo=mail-wm0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/13-25142-4C510F65 for ; Mon, 21 Mar 2016 10:39:49 -0500 Received: by mail-wm0-f44.google.com with SMTP id l68so127015802wml.1 for ; Mon, 21 Mar 2016 08:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=SiGSCDG84VDP4cIgJ5Uhn0TpWTvfnZChIRulBO220fE=; b=W3gpDZDcmVRwnyWbtFia9aLYRi99mJjRWJF3CaAZW47T85LwecGVeHSCTxEPadYoKc KQ5V0WFKPrtxmOYzG0VgQPZkEsfVKRJhuWUsrFtXiyjr82Wqi//xSc4S4azl3wQDhfLL wPcdaC4gXFEoyDe/Qsfc0v5RacCn6znkCNsl77FcT+sqZ4yF174BieNQpn26aKbALzuw PDIC3Vl67WDOzV+LwXLmIlAzOpbf+qFHM5DNeO2xb8aocOaCRZbcFlKxynS/uyH0uGt/ hN/lfLtcT2eJ4r/IIRs3w04Oe5ST/xStMI3m/Gwfm+dVgS2lqRmkA687Ca99pW+tFBm6 picg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=SiGSCDG84VDP4cIgJ5Uhn0TpWTvfnZChIRulBO220fE=; b=EZKEXWhraHVelFvfthUmli6x33XDsJChNeNRG2EyJoUnPG1TSwix3WdXZtmGO75Mlv 2vI9p/USahs+agBmBI1D8raE9AeeQyn7HJRRSIyW8hIvCidD0bqOnSEld16CQz8n7BvQ hqiwRmzhLX2f6i9l9mvqmzVUUnessTEL/yECMBSWVsLulbjvUmSIYvXZU106ixa8Z7ee +Wu7s1ffIY3Xc0Zi9vveNJzd7Nh5+nuP6O3Zb36Vv7zvozVbkOmct3eu8MbEa7JmLXcF QP6xNvrYwCjUXRrrrjdHslCTxSZOY/WX3SHkgXZDXunRgGwUnRz+wbWxFjSrO+DIZdac OBYg== X-Gm-Message-State: AD7BkJKDUn4WrWm573Oe/R8k/85CTcJ5TftJEe8d1I1B3lfsOuxeVDHTzu+OHk8J+3lXPg== X-Received: by 10.28.125.141 with SMTP id y135mr14190189wmc.83.1458574786247; Mon, 21 Mar 2016 08:39:46 -0700 (PDT) Received: from [192.168.0.82] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id gk4sm25906959wjd.7.2016.03.21.08.39.45 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Mar 2016 08:39:45 -0700 (PDT) To: internals@lists.php.net References: <1458149992.3969.2.camel@kuechenschabe> <1458151531.3969.8.camel@kuechenschabe> <1458153695.3969.16.camel@kuechenschabe> <3F.70.02405.6803BE65@pb1.pair.com> Message-ID: <56F01545.8080008@gmail.com> Date: Mon, 21 Mar 2016 15:37:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <3F.70.02405.6803BE65@pb1.pair.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC Discussion] Typed Properties From: rowan.collins@gmail.com (Rowan Collins) Andrea Faulds wrote on 17/03/2016 22:32: > Hi Johannes, > > Johannes Schlüter wrote: >> 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 :-) >> > > Disallowing references here might make users more aware of which > functions take parameters by reference, and avoid accidentally > modifying values. So this part of the RFC might be a good thing. I'm not a fan of this kind of side-effect coupling - "because this feature is new, it also triggers other new features". If you want no-ref properties, that should be something a user chooses directly, e.g. "class Foo { public noref $bar; }". Adding an "array" typehint to something absolutely should not prevent it being passed to sort(), IMHO. Perhaps we could have an IS_TYPED_REF zval? You don't actually need to store the desired type, only assert that the old and new reference targets are of the *same* type when performing assignment. Regards, -- Rowan Collins [IMSoP]