Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90454 invoked from network); 18 Feb 2016 20:58:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2016 20:58:16 -0000 Authentication-Results: pb1.pair.com header.from=colinodell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=colinodell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: colinodell@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:33657] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/35-62769-76036C65 for ; Thu, 18 Feb 2016 15:58:15 -0500 Received: by mail-ob0-f170.google.com with SMTP id jq7so86808111obb.0 for ; Thu, 18 Feb 2016 12:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=F/JPgOZ9OJf5sVbQV09hPzif7gYDvNhy3C1ALBLwZ5A=; b=G6Wm8oh5axliCoCN/Y54GcMnojwjUcxIUhK7GXaSv4TqjvANTldyKpdvQpYu/1vZLb K1bUYH2tFtCRZyCmIf6hhXUbeq9O23gIzhaabeZcUzcfcOvqsMfwbmqaQnLtyAuD+1YS QsoKX9DfiHqG92tiabWoQHvu0PcdyKbBBJpL/d78S5qZ1hA+kGFOsWkBmWHNU2RN+5fM cni+58kCE86ZUUyaYJOwGoczR5PTNdXOPl3godWbRbFTjiwD5h9L/vfnqmhKBGNQIoEf Wwkhw8uDEL+TfM6g3cq87S3NLTumF69AONYLClS50Il3rG/JOuDQobHz+n+CR7+eWkqi +sYw== 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:content-type; bh=F/JPgOZ9OJf5sVbQV09hPzif7gYDvNhy3C1ALBLwZ5A=; b=VuRYC3DYdrCfYrhgGZED+LQXzuFMVEQL0BGN13G45VaRdp9AKWDoz/14mjYKMuVGxC qjRbETOB4wAyUmKnAdoH7pE/WTFTzc/GDHm6hV6aOr4zOzRySRQazEAzRFzcBHcHiVof wfwlezXi3Y/F36vQZzbuR1Zat5r93sZpdDNDR1g8xo8PjseEc/wGWkzEWtaFqMUAoWLu z8wHw6tF3tz3fCyqC4yw4TXOXjnp1yQi4yUpMy4BjqGRzYitVS6r7HKQcmn6XfzFDDyr 1X1jOKsZY2QGLWm3cGdkumWCfiZqBWB+6dcYJamHBIKq7r9OThWb/JC0SQ7xkG3tGHC3 mHww== X-Gm-Message-State: AG10YOQfgyLeeI0jLhJZKR8mSrdtLaYN9XyGwTZLPeXPr4po47c6NCu6DEblLaQazlPyZHt1BvaltwWvgzYvMg== X-Received: by 10.202.63.6 with SMTP id m6mr3660266oia.91.1455829092221; Thu, 18 Feb 2016 12:58:12 -0800 (PST) MIME-Version: 1.0 References: <56C61BE2.3090509@php.net> In-Reply-To: Date: Thu, 18 Feb 2016 20:58:02 +0000 Message-ID: To: Walter Parker , PHP Internals Content-Type: multipart/alternative; boundary=001a113dd180e54da9052c119f7a Subject: Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal From: colinodell@gmail.com ("Colin O'Dell") --001a113dd180e54da9052c119f7a Content-Type: text/plain; charset=UTF-8 > What are your reasons for this proposal? > > I can think of multiple reasons why this might not be a good idea, but the > only reason that pops to mind for getting rid of it is to make PHP work > like a different style of language. I'm proposing this change because it will remove duplicate functionality from the language. In PHP 4, "var" was the only way to declare a class member variable. PHP 5 introduced three new keywords for this purpose: public, protected, and private. "public" is functionally identical to "var". According to the docs: > Class properties must be defined as public, private, or protected. If > declared using var, the property will be defined as public. This is great for backwards compatibility from PHP 4, but it ultimately results in having two different keywords which do exactly the same thing. Does PHP 7 really need two keywords for declaring public class members? We're already removing PHP 4 style constructors in favor of the PHP 5 style ones, so why not also remove the PHP 4 "var" keyword in favor of the PHP 5 style keywords which explicitly state the visibility? For the small percentage of projects which still use "var", upgrading their code would be dead simple: just replace "var" with "public" everywhere you see it. I'm sure somebody can easily whip up a tool to automate that process. Because current usage of "var" seems low and the upgrade path is so simple, I don't think its a bad idea. Colin On Thu, Feb 18, 2016 at 3:25 PM Walter Parker wrote: > On Thu, Feb 18, 2016 at 11:30 AM, Sebastian Bergmann > wrote: > > > On 02/18/2016 02:10 PM, Colin O'Dell wrote: > > > >> I'd like to propose an RFC to deprecate and eventually remove the "var" > >> keyword. > >> > > > > +1 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > What are your reasons for this proposal? > > I can think of multiple reasons why this might not be a good idea, but the > only reason that pops to mind for getting rid of it is to make PHP work > like a different style of language. > > > Walter > > -- > The greatest dangers to liberty lurk in insidious encroachment by men of > zeal, well-meaning but without understanding. -- Justice Louis D. > Brandeis > --001a113dd180e54da9052c119f7a--