Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21516 invoked from network); 29 Feb 2016 11:36:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Feb 2016 11:36:03 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:38114] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/41-10408-22D24D65 for ; Mon, 29 Feb 2016 06:36:02 -0500 Received: by mail-wm0-f49.google.com with SMTP id l68so54360961wml.1 for ; Mon, 29 Feb 2016 03:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=zDwGUtnMYdru5wgLu1WvPQSGQTmA5uq3xlMffxLtA9Q=; b=bZQSEY++w0Q9S+NXvh37imceULjuePbLPkzQ2gV8sFJLYz+8Wjhc2kps5T5EE7huFa avjD+8Sa0RmTC2aD4QUmbl9lgXET30F7tX+BL/vruG36pc7dORNdiZEEYcfLmBdt19t7 RN9hT5n09s7KbluzVtzx5YL6h3LUVOBarTi6PjtB+kkajHcHB59xVQrmmWlAYnjmn4m9 G324opIkGEZsjtBPbINo48xQTbrU0jdRGypF112Xi+Gr/Veb/Es4/YlsHj+PtEFsyy+9 2Sq3bqC2gyXgVKaMOGbyTR2eqBSIhn3hw6htQf+Dn4OXLVJEOLAMDCy9SZktvOiz6T1Q IJ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=zDwGUtnMYdru5wgLu1WvPQSGQTmA5uq3xlMffxLtA9Q=; b=UfZkHgsmQq4FMxmLpjnkx9o4cPNwm3sFYLUJ738go+GZb3NyzcKHfK1D3tLkZRBmot x+D5KFn4Mmuu03PTX1+yZ5MBV6tC4T2DcfjVoIkjGMnzsi06o2tAIUIjoNz9/k4ezIh5 Ru4IlAT0k3YPWobQW0k7Hs/ltOohhobWA8d37040Ke1CYQEQY+AtpeiNKVLNEks2LY+K ULHbEJKmPBYDVcg6sgCwMXkhALJbLYp/FcZscg+dC0r8RhmR3iZFMa8bAqHQQZRIwNz6 EBXic3WlIvNByBz7PAkRNYfeVuJ+7TseK6dyGWR7GOkdafVWnw4RJNWV9jrmj/vyfflm yCCA== X-Gm-Message-State: AD7BkJI2VjBDs8KbVRDPcqe79KBaLRNDvE9rfIURLDf3xgxaaurv6D40jKo33QshjKI9sA== X-Received: by 10.194.83.134 with SMTP id q6mr14127494wjy.131.1456745759592; Mon, 29 Feb 2016 03:35:59 -0800 (PST) Received: from [192.168.0.141] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id da6sm16009296wjb.24.2016.02.29.03.35.58 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Feb 2016 03:35:58 -0800 (PST) To: internals@lists.php.net References: <1F.91.55238.41F10D65@pb1.pair.com> Message-ID: <56D42CD3.6020602@gmail.com> Date: Mon, 29 Feb 2016 11:34:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------000901030801090503040502" Subject: Re: [PHP-DEV] [RFC Proposal] var keyword deprecation/removal From: rowan.collins@gmail.com (Rowan Collins) --------------000901030801090503040502 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Tony Marston wrote on 29/02/2016 09:55: > "James Titcumb" wrote in message > news:CAKnqCEY7art1GUWG=Pm0wyPGQmYp0Dq8oxdohgBkSGq+O_BTZw@mail.gmail.com... > >> >> On 28 Feb 2016 06:18, "Jakub KubĂ­cek" wrote: >>> >>> 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 >> >> If it's public, it will be modified by someone. > > Incorrect. It *may* be modified, but surely any invalid modifications > will be detected in the testing phase? Detected by whom? Using what tool? I'm not aware of any generic way of logging all access to particular properties, nor quite what "invalid modifications" mean in this labelling scheme. Maybe it would be detected during *review*? Apologies if that's what you meant and the distinction sounds pedantic. A better way to mark this kind of distinction is using PHPDoc annotations, which can be made readable by both humans and tools. For instance, PHPStorm will cross through any uses of a property marked "@internal"; I wouldn't be surprised if other IDEs and tools can pick this up as well. In this case, you could just use the fact that the property is labelled "@inject" to mark the distinction, and you'd be no worse off in terms of tooling support than you are now (i.e. IDEs will not come with this interpretation of "var" baked in anyway). Regards, -- Rowan Collins [IMSoP] --------------000901030801090503040502--