Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91632 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79718 invoked from network); 11 Mar 2016 10:27:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2016 10:27:55 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.41 as permitted sender) X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 74.125.82.41 mail-wm0-f41.google.com Received: from [74.125.82.41] ([74.125.82.41:35075] helo=mail-wm0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/D3-50603-9AD92E65 for ; Fri, 11 Mar 2016 05:27:53 -0500 Received: by mail-wm0-f41.google.com with SMTP id l68so12189195wml.0 for ; Fri, 11 Mar 2016 02:27:53 -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:to :cc; bh=flskoPnLvuuSn5VzcsZ4A+rKg6rfCKf0vgb97jJfUTA=; b=YJP7oblBmn+uR1lu75Xn8px4UNsYI2V2JzmPJSEgyupaMeNjvWG27kMgEXqtZap+7J 2UjAz7pOUd6UIgPS2hcnzapck9TCEQwJXGstrXIFFzJWmaBkEx4C8tx5eISpFx23vF+e dSt+F9QZDRqVYOYnpxp23znOZYNm2fWSpw4AkVws/j8luhHkm/Mli4FZMO+j94ENXWbM LOTMnlIyB0AofuKZYJqHkzAu+cQ2cFC3PpgT9hnhaWbjX1UiUOozJX4pWV8CtsPBd8Bn KGTk5DSBPiwR7L196c+rC2JXkwQygwZHBQsLJ2opMErExLjAZUYJb6JFZgcxz6NgLp4S 1lFw== 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:to:cc; bh=flskoPnLvuuSn5VzcsZ4A+rKg6rfCKf0vgb97jJfUTA=; b=kmbDYcAvfwjdGezTaT3MCqwjskjKiFAom3HFNegr9iSUjgvnbOPFuI54/zWRab+xSQ YDhwi3GdwBGaHKjoEFuJRP6MERQihj06QmalztgH2aYOKFJOa7CqkTrypCylPInkQJ0/ 5bQrU4p/inKRiwx5uqbbhcGfsFuaQcLwDrNS+eqzEf1EWwyE4nO5WVRHtRs5J2pJKylJ 0Z0IH4vuEMgyquW+d7mZDBnvlwDRfUgMKQShCG/Kpdi6qRzjwkLpJfTv9b3zdEAJY99w PsVpUCldTMkYdUp4phCvZlLoay16GmZg5kiD9rffuz89569hdRXUwmRVFMQimAs2gEAn XTzA== X-Gm-Message-State: AD7BkJKPEnQuLgjV0yK3WB3AzzLQhAdtRYnApm8sLUvaXm558Wr+39YHuvIY6dRqp4cqIKUTe+FTRphk0kXszw== X-Received: by 10.194.22.35 with SMTP id a3mr8953438wjf.165.1457692070822; Fri, 11 Mar 2016 02:27:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.64.138 with HTTP; Fri, 11 Mar 2016 02:27:31 -0800 (PST) In-Reply-To: References: Date: Fri, 11 Mar 2016 12:27:31 +0200 Message-ID: To: =?UTF-8?B?SmFrdWIgS3Viw63EjWVr?= Cc: "Colin O'Dell" , PHP Internals Content-Type: multipart/alternative; boundary=047d7b5d4a2612cbce052dc36203 Subject: Re: [PHP-DEV] [RFC Discussion] "var" Deprecation From: arvids.godjuks@gmail.com (Arvids Godjuks) --047d7b5d4a2612cbce052dc36203 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2016-03-11 12:03 GMT+02:00 Jakub Kub=C3=AD=C4=8Dek : > From the RFC: > > > > var is therefore a limited subset of public. > > > No, this is wrong. `var` was here much much longer than `public`, therefo= re > `var` is not a subset of public, but rather `public` is _an extension_ of > `var`. The keyword `var` is also unique for it's semantics in the later > versions of the language viz. previous discussion: > > - `var` represents not any certain visibility, it states that the > visibility of property is yet unspecified > - `var` can semantically also represent an internal dependency, as I have > described earlier > > On 10 March 2016 at 22:44, Colin O'Dell wrote: > > > Hello all, > > > > I have completed my initial draft of the RFC to deprecate "var" in favo= r > of > > "public": https://wiki.php.net/rfc/var_deprecation > > > > I would greatly appreciate any feedback on this RFC, especially with th= e > > 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 > > > > > > -- > Cheers, > Kubis > I'm gonna fire anyone who does anything like you described from my company straight out the door no questions asked. Period. var $_id; =3D> is that intended to be "private"? But I can access as a public. Or is it meant to be "protected"? Can I actually modify it directly or is there a setter/getter? IDE gives me autocomplete from outside of the object, then I surely can do $object->_id =3D $something; var $id; =3D> Well, all of the above. Internal dependency? Good god, that's what private/protected are for. You really overestimate how much people really care about the 3rd party code and how it's intended to be used. I know of instances that people just took 3rd party code, modified some property to be public and didn't give a damn about that. And you want to define internal properties as "var $property" to be available for public access? If some project is using "var" as a special snowflake, well, it's their problem, not the communities. And our PHP community is so large, that even projects like Symfony aren't really dominating the landscape, and those guys do have influence. Sorry, but that's just bad decision making. Also, there are docs, official docs here http://php.net/manual/en/language.oop5.visibility.php that state: "Class properties must be defined as public, private, or protected. If declared using var, the property will be defined as public." Sorry, but "var" is a legacy at this point. No sane code is written using it, you don't even have a dedicated manual page or paragraph for it, just a single line stating that "var is essentially public". And replacing var with public is already automated for you with a script provided with the RFC. I'm sorry for my ramblings, but I just couldn't leave statements like that without opposition. --047d7b5d4a2612cbce052dc36203--