Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82526 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65180 invoked from network); 12 Feb 2015 11:57:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 11:57:29 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:53720] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/E2-50473-8259CD45 for ; Thu, 12 Feb 2015 06:57:28 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 1A4B72400D0; Thu, 12 Feb 2015 06:57:26 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id W0FkmpGLoZxF; Thu, 12 Feb 2015 06:57:25 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 62DFE2400AA; Thu, 12 Feb 2015 06:57:25 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Thu, 12 Feb 2015 11:57:23 +0000 Cc: PHP Development Content-Transfer-Encoding: quoted-printable Message-ID: References: To: pierre@pcservice.co.za X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] [RFC] Deprecate properties using var From: ajf@ajf.me (Andrea Faulds) Hi Pierre, > On 12 Feb 2015, at 11:51, Pierre du Plessis = wrote: >=20 > Before I create an RFC, I just want to get some feedback on a = proposal, to > deprecated the use of "var" when declaring properties on a class. >=20 > This was previously deprecated in PHP 5.0.0 and the deprecation notice = was > removed in PHP 5.1.3. >=20 > My proposal is to deprecate the use of var on properties in PHP 7, and = then > remove support for it in PHP 8. This compliments the [0] "Remove PHP 4 > Constructors" RFC, as it is old PHP 4 behaviour, and according to the = docs > is only "supported for compatibility reasons", and personally I think = users > should be encourage to use proper visibility when defining properties. What=E2=80=99s the benefit here? It seems like a needless = backwards-compatibility break. PHP 4 constructors have been proposed to = be removed because they cause problems (Filter::filter) and it = simplifies the language. What problems does var cause? Its existence = doesn=E2=80=99t seem to hurt anyone - sure, using = public/protected/private is better, but this only matters if you=E2=80=99r= e reading legacy code. I=E2=80=99d also be wary of removing it if = we=E2=80=99re going to get rid of T_VAR, as that seems like a useful = keyword we might reuse later. So I don=E2=80=99t see why we need to = remove this. It=E2=80=99s also worth noting that removing PHP 4 constructors is = unlikely to go ahead. I think Levi is planning to simply deprecate them = instead, since it solves the main problem (Filter::filter broken) = without breaking BC. Thanks. -- Andrea Faulds http://ajf.me/