Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91447 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99824 invoked from network); 28 Feb 2016 06:18:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2016 06:18:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=kelerest123@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kelerest123@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.174 as permitted sender) X-PHP-List-Original-Sender: kelerest123@gmail.com X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:34510] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/BC-55238-05192D65 for ; Sun, 28 Feb 2016 01:18:57 -0500 Received: by mail-ob0-f174.google.com with SMTP id ts10so110425717obc.1 for ; Sat, 27 Feb 2016 22:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=VsM1e+/UI6KuNuKVIwVKTIIsLlJBVmNoXqWl619vljU=; b=qK983WJS4L/JoVw40IjS0QrD0pw/0q5M2P0k5MmQtRSAdDTDFvqYbv/NyXR1aIPzjx U1YCGAUF//VvMPMTOMLYLFPqXCF0lck2Dy3vZcynqnI2UzMeBnaJPQdCnn49v0WqZTQI sw0j5HJrAQSzTKGPdSAoVaFDiOBZQzCTF/YSXO609eD7QM1ua7tQpxr5Q+1qRSRCOQ8d 90qDvo4uITn8jvNKEE0v6xQr6RxVf1sDT6Ru+bQK7BaMB4HUlLLFQ6DDws6hm8FWbpM0 ChcVQ1nMj+/GjOXGeQyYN+zU7GpHXvseQhHvudGCtVa0Cj+62k/D2JM6tt1StTmznfJ+ MVfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=VsM1e+/UI6KuNuKVIwVKTIIsLlJBVmNoXqWl619vljU=; b=lDQrl3oZNwdgxnvTbo0MqFwalMoHkHO4EL4Bd58gJ4IhoyT3tEHQCFyZMAdJrKRwXL BcKgwxgAOUiB5cbvdKY+Lz8eXHiWXaWNhIVuTxTDFk9il+3b78lRWG/2L2amsv+Ib08/ dTjRbsxjnT1DWQ9gO4o1JH1VUJgkkCVz4WnO3M3sS41FgbRktWZ3uvZYeh9fmKv7i1W5 /cLE/jCsCnlCHOw1eqJmCHq2T9a5NnWd9r7yiA+GC18k6lowtMRxSEWyQIA/wnpQ9iA+ wBBMxqs+QBupHpXmQGJYTEQFjGAyWv+Lzny19UfkVfIU0uE3ZeCWNUN+ReoEFDQJsu/Q 9rpQ== X-Gm-Message-State: AD7BkJLSJEvjjzM2jlzQB0xM/EZQeGDsLxL4z10PAdyM8RgaScqWq8QRGBSeVx33QVyBMZmyTJ0YdbLP7xQ2Uw== X-Received: by 10.182.24.8 with SMTP id q8mr7082054obf.67.1456640333935; Sat, 27 Feb 2016 22:18:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.73.195 with HTTP; Sat, 27 Feb 2016 22:18:34 -0800 (PST) In-Reply-To: <1F.91.55238.41F10D65@pb1.pair.com> References: <1F.91.55238.41F10D65@pb1.pair.com> Date: Sun, 28 Feb 2016 11:48:34 +0530 Message-ID: Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal From: kelerest123@gmail.com (=?UTF-8?B?SmFrdWIgS3Viw63EjWVr?=) Good morning Internals! I am strongly AGAINST the removal of the `var` keyword from PHP syntax. Though in general it's an alias of `public` (or it simply =E2=80=98acts=E2=80=99 as the `public` modifier), I see a difference in its _semantics_. While the `public` modifier states anyone can change the property, `var` is useful for marking internal properties which must be public, but should not be manipulated by simply anybody e.g. in the case of dependency injection: fooService thanks to DI container } } ?> This idea comes to me from using the Nette Framework, which handles DI automatically and this way -- using `var` -- one can semantically mark, which are the internally @inject'ed properties and differ them from the `public` ones. On 26 February 2016 at 15:16, Tony Marston wrote: > Sent: Thursday, February 25, 2016 12:58 PM >> >> To: Tony Marston >> Subject: Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal >> Hi Tony, >> >> Thank you so much for your feedback. You make some really good, valid >> points. If I may provide some responses to some of them: >> >>> Where is your proof? You say "not used by a major part of the community= " >>> which means that it is still being used by a minor part, but exactly ho= w >>> "minor"? >> >> >> I downloaded and scanned the top 10,000 projects on Packagist (including >> their dependencies). > > > So you examined a bunch of source files in one location? What about those > projects that aren't maintained on Packagist? Mine certainly isn't. > >> Only 4% use "var". I looked closer into that 4% and found almost 2/3rds >> were due to a handful of prominent packages being required as dependenci= es. >> Adjusting these packages would drastically lower overall usage across th= e >> ecosystem. And because "var" is simply an alias for "public", making th= at >> change would only require a bump in the patch version. >> >> I'm not 100% happy with my methodology because the dependencies are >> counted multiple times. When I have some time I'll revise my approach t= o >> get more-accurate figures. > > > The only way to obtain what could be called "accurate" figures would be t= o > examine every PHP script ever written. What you have is nothing more than= a > small sample. > >>> it would take effort to take it out... >> >> >> >> Here's a simple PHP script which does this automatically: >> https://gist.github.com/colinodell/5fb5e5d474674f294a38 Because "public= " is >> supported in 5.x and 7.x, programmers could run this script at any time >> before the 8.0 release (assuming this proposed RFC passes and the progra= mmer >> wants their code to run on 8.0). >> >>> ...and amend the documentation >> >> >> >> I will happily make that change myself. >> >> >>> while programmers expect new features to be added they do NOT expect ol= d >>> features >>> to disappear. Once a piece of code has been written and has proved to >>> work >>> as designed it is expected to work with all future versions. >> >> >> >> I'm hoping that the automated upgrade script and advance warning would >> help mitigate that impact. > > > I, and others, will object to having to run any sort of conversion script= s > just because you personally don't like the "var" keyword. It does no harm= , > so there is no benefit to be had by taking it out. > > > -- > Tony Marston > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Thanks! --=20 Cheers, Kubis