Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91659 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16112 invoked from network); 14 Mar 2016 18:14:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2016 18:14:15 -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.218.50 as permitted sender) X-PHP-List-Original-Sender: colinodell@gmail.com X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:35982] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/90-11272-67FF6E65 for ; Mon, 14 Mar 2016 13:14:15 -0500 Received: by mail-oi0-f50.google.com with SMTP id r187so140080097oih.3 for ; Mon, 14 Mar 2016 11:14:14 -0700 (PDT) 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; bh=MUdu1upL01uqqmmXLi0yBX0uXWcBlF+oOGyE4KHYK5Q=; b=Qj6UkWUOPYgAVyJZ2lap3smElB5xU4OKRr/N0JC+/jjwFa4SyKicF99FYLqZmAWzZ/ WYu0GSdb+3oCViCTrbEVytOj032uQX2Iyt28Tb3AaD/LhrbHzxaBNG3T+5GgaUqu7hpt N7Foqwq5cgF5+arQQg5QhTXB+E9wmw+Za8al4Ivj3bv/aslD8R0HIAZWzhFWxWJmiJ8D /lRFqx/BnSiPsXlfQU28R/RPb2nWMmES+3XOwoqSJuP8rjBJE6Ja0PfxGBNdE3nfskxi ZrFFk5/TprflLAkoSOhj/YBbQ+l9bg6i/5+PZd0nHrf5Wjs77XPoOAHFVYf6ezk3+ugZ IAMw== 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=MUdu1upL01uqqmmXLi0yBX0uXWcBlF+oOGyE4KHYK5Q=; b=QZUwE/5I3QpNm5HkA2usMg9PHJgCEVYObWkHGGp6Go5lhlazTh3jmvY1Qyp4gjX3fl QV7iGuy0Qdj9Q7Amhd4OR3TrHJnAY/BqjLG/J/cdMEijWFv5m3UXN8f+gqrST2BKpObS CUvoX3fsmE2RxYubA8DhERuBjG/QlJ4HbaPq9tLzsI85r16FKTjI9zCgw5fVIcXCpl6N z3A7UhlmXWveWtOEtQoeVKo8jueMYr0mKRVmysaueo41AIFYzNoMLX4heY79mVpPXDZC gAm786gETRvVmGjcJU9ETtIqqZCJUWtSx/Tqv0g88lsjZI7iUXdvKRdM8Fj5RAEqZmDt Zbew== X-Gm-Message-State: AD7BkJLzYEr5qYgFwtTjJmCfFJtxe/CR2Un8PfoFa07jqcCb6Jk747ToonbGJ1t8Dqc1PZrzm+w2cyoRQqrsYw== X-Received: by 10.202.104.19 with SMTP id d19mr14391540oic.6.1457979251984; Mon, 14 Mar 2016 11:14:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Mar 2016 18:14:02 +0000 Message-ID: To: Patrick ALLAERT , PHP Internals Content-Type: multipart/alternative; boundary=001a1140fa16678fa2052e063f75 Subject: Re: [PHP-DEV] [RFC Discussion] "var" Deprecation From: colinodell@gmail.com ("Colin O'Dell") --001a1140fa16678fa2052e063f75 Content-Type: text/plain; charset=UTF-8 > > Forcing people to specify a visibility for properties and not for methods > would add yet another inconsistency in the language. > That's a really good point. However, I think we currently have a different inconsistency: declaring functions without explicit visibility is possible without needing an extra (and redundant) keyword. The inconsistency you mention could easily be solved by a future RFC. We could: 1. Require visibility for class methods. 2. Allow declaring properties without using any keywords. 3. Use some other approach? I don't think we necessarily need to choose an option at this time (or perhaps ever). > #1 > class Example { > var $foo; > } > > #2 > class Example { > public $foo; > } > > #3 > class Example { > public function __construct() { > $this->foo = 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? > Correct. This RFC only targets the deprecation and removal of T_VAR. > 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 disagree - this RFC does not prevent anyone from declaring properties, you just need to explicitly declare the visibility. > 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. > I disagree on the third point - I think the automated upgrade process is literally the second-easiest upgrade possible (#1 would be no changes required). Nevertheless, I truly appreciate you considering and weighing the different aspects of this proposal. I'm hoping others will take a similar approach in deciding whether they support this RFC. Thanks for your feedback! Colin > --001a1140fa16678fa2052e063f75--