Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91658 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13447 invoked from network); 14 Mar 2016 17:34:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2016 17:34:57 -0000 Authentication-Results: pb1.pair.com header.from=patrickallaert@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.48 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.213.48 mail-vk0-f48.google.com Received: from [209.85.213.48] ([209.85.213.48:36351] helo=mail-vk0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/20-11272-F36F6E65 for ; Mon, 14 Mar 2016 12:34:55 -0500 Received: by mail-vk0-f48.google.com with SMTP id c3so217921851vkb.3 for ; Mon, 14 Mar 2016 10:34:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=KgzWtxO46JruvCdzDcMOtfviPr1MsmRgq/Es2Ui9Kt8=; b=UZrjxCOXG3RixAp+vRqbATv0rErpGaUY7kYKpXgO96JYSDIVnnMNNYnhJfdTdQITn8 qzuWHMQptxtGeo+QqoDbTecTaiR5UDu81UfPX/A3jo//7U/PO1hsCXG/JGnGIAPLzJnu fuEf+pxFw6Njjh1+P278P1ItvhZ0hebDGm/WWX/RHkVEhdyZllt2qPky+8R90JeO0kkm MErWdWOsWXisDldbCgcnafUDUbBOb1ZAuBnGjsv4srihiqsdqt1Yy6HfLr6EGXpAxl+g 3PysnGI8rIQC+5HJGrFY8U3a0YRTaToQY2MuREWa3sDWYWG+RMPfuO+YW+6jGRQesvV6 UmxA== X-Gm-Message-State: AD7BkJLKhiafTxCTtHiBHvgY0vPn7qvO0XLdKRdyWAcVzOU7s5I+YzIbJoocnKqoFoQec+hBenay93GHkzq6/g== X-Received: by 10.31.54.75 with SMTP id d72mr25803326vka.30.1457976891974; Mon, 14 Mar 2016 10:34:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Mar 2016 17:34:42 +0000 Message-ID: To: "Colin O'Dell" , PHP Internals Content-Type: multipart/alternative; boundary=001a11430a1ebcacbd052e05b296 Subject: Re: [PHP-DEV] [RFC Discussion] "var" Deprecation From: patrickallaert@php.net (Patrick ALLAERT) --001a11430a1ebcacbd052e05b296 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le jeu. 10 mars 2016 =C3=A0 18:15, Colin O'Dell a = =C3=A9crit : > Hello all, > > I have completed my initial draft of the RFC to deprecate "var" in favor = of > "public": https://wiki.php.net/rfc/var_deprecation > > I would greatly appreciate any feedback on this RFC, especially with the > following: > > - Ensuring that all major arguments for & against have been documented. > - Any impact this may have on SAPIs, extensions, or the opcache. > - Any assistance or guidance on creating the patch (I've never written C = or > worked with the core codebase before). > > If you'd like to read the pre-draft discussion it can be found here: > https://wiki.php.net/rfc/mailing_list_discussion > > Regards, > > Colin O'Dell > Hello, Related to what's mentioned in the RFC under: "public Is Not The Same", one can use "var" to declare a property without specifying its visibility and this is true for method as well: "function" is equivalent to "public function". Forcing people to specify a visibility for properties and not for methods would add yet another inconsistency in the language. 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". I'm generally in favour of not having duplicated ways of doing the exact same thing. I'm generally in favour of not introducing (uneeded) BC issues. I'm not convinced that the number of people that will benefit the uniqueness of declaring a variable would be greater than the one suffering upgrade issues. For that reason and the ones above I'm -1 about this RFC, even if I am not satisfied with the fact we can still use "var". Regards, Patrick --001a11430a1ebcacbd052e05b296--