Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91661 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19503 invoked from network); 14 Mar 2016 18:30:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2016 18:30:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.126 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.126 mx205.easyname.com Received: from [212.232.28.126] ([212.232.28.126:50955] helo=mx205.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/41-11272-C2307E65 for ; Mon, 14 Mar 2016 13:30:06 -0500 Received: from cable-81-173-133-29.netcologne.de ([81.173.133.29] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1afXFf-0005Ke-WE for internals@lists.php.net; Mon, 14 Mar 2016 18:30:00 +0000 Reply-To: internals@lists.php.net References: To: internals@lists.php.net Message-ID: <56E70317.1070101@fleshgrinder.com> Date: Mon, 14 Mar 2016 19:29:43 +0100 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: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QbH0c5rkEUKTG8lPkmOOmiknkgU76prjO" Subject: Re: [PHP-DEV] [RFC Discussion] "var" Deprecation From: php@fleshgrinder.com (Fleshgrinder) --QbH0c5rkEUKTG8lPkmOOmiknkgU76prjO Content-Type: multipart/mixed; boundary="40GNUqn861lkhiuQLAHp48rME5gOUciic" From: Fleshgrinder Reply-To: internals@lists.php.net To: internals@lists.php.net Message-ID: <56E70317.1070101@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC Discussion] "var" Deprecation References: In-Reply-To: --40GNUqn861lkhiuQLAHp48rME5gOUciic Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/14/2016 7:26 PM, James Titcumb wrote: > Yup, agree with this. In my opinion, I'd like to see two birds with one= > stone, but a separate RFC is acceptable I suppose. The only risk is one= > change getting voted in and not the other, leaving an even worse > inconsistency IMO. I think this RFC should be all or nothing: require > visibility for both methods and properties, or do not require anything.= >=20 +1, but ... On 3/14/2016 6:34 PM, Patrick ALLAERT wrote: > Besides that, there isn't 2 ways for declaring a property, but (at least) 3: > > #1 > class Example { > var $foo; > } > > #2 > class Example { > public $foo; > } > > #3 > class Example { > public function __construct() { > $this->foo =3D null; > } > } > > If I understand this RFC, example #1 is handled by it, but not #3. > Using #1 would emit a deprecation notice, but #3 wouldn't? > As far as I am concerned, I think it is still better to declare the > properties rather than not and this RFC would (somehow) favour not > declaring them at all than doing so with "var". > =2E.. #3 is a different language feature of PHP: dynamic assignment of properties to objects. Userland code does not and should not care if the internals code creates these dynamic properties with *var* or *public* or *very-special-internals-visibility-modifier*. ;) --=20 Richard "Fleshgrinder" Fussenegger --40GNUqn861lkhiuQLAHp48rME5gOUciic-- --QbH0c5rkEUKTG8lPkmOOmiknkgU76prjO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW5wMgAAoJEOKkKcqFPVVrlFkQAJPBsLmve9M2PQTTnbUix7rt eB8QKf2MfCTIjZFGyHNaijKv+qu/+L6Z86Rc7vGx66/cFRy26bnrFLa0RC++pZt6 jQw/nfHIJTsn0jvg/amMeIl11m/MC2KNpitLKShlkaa778Y9YioSVLaGDdVzwNjQ hW06yhRjHZs+4j4idh/sOK84cylkJo1/cMGNIMzeXmShlcM8diUqE4ohCHWi6+U9 7YxYyuk59XZEPoUO2/bwVa1JsOxAwKtwqNYvQy7quM5/5n3CbNrd9xGIGwueCYOe m5ZeXV9Gl9b1bNChH3AjQ4YSwzYlUE+/TKuYpMAzjst5txPPJKv3CeiN8zsh1XsK ceP0xLoc3ZHQ3LZmg+J2DgDid1GXMyiXWhNTsgSYHRFLM3KfINW/4n6hD3neOnmw J6WuSyFylioLHNFcAkYNVs7/BEiHprRyHFhnbzubr8pQYx1zmn7zgA2ZR4hZhpaB kCMI8NxzXTyRSWsK00eV2dAl5rNGcrFrf27McmoDviAmrwTR+nFj4caIGyTPE3ZG A/8zNWdqQNJTH2fyUITdfE5RpQHTy8YNEYdG8YfVmcdY73vTMJE7doBdvy9JTUXS 0cmz8lUBc2nWXCESDESiEps1q0qsN+weEzaOww+rqyxyl7TyL4eCdiGLFXJadO/Z qgIaSNpF348zW1aHhkUT =d25t -----END PGP SIGNATURE----- --QbH0c5rkEUKTG8lPkmOOmiknkgU76prjO--