Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88077 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66498 invoked from network); 7 Sep 2015 07:02:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2015 07:02:50 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.42 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.42 mail-pa0-f42.google.com Received: from [209.85.220.42] ([209.85.220.42:33748] helo=mail-pa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/93-40368-9963DE55 for ; Mon, 07 Sep 2015 03:02:50 -0400 Received: by pacex6 with SMTP id ex6so88259176pac.0 for ; Mon, 07 Sep 2015 00:02:47 -0700 (PDT) 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:content-type:content-transfer-encoding; bh=I9d3FtrGdZV7KoX4l34Km49pu7Lf48uYR4muFlZKkvY=; b=eUJC6RyXRXkO/bM4lg82D96eGGtCiaW01z2Zp9DgEozKGwXaC+9m+O1HIXZAyW762F c6IXwVDBmM+v0UC9Jw9tH83v2bAIa/7CWKjGA517wFR+QdzkCGfOfEwI/mEjY3vGPjbW hW8ZKG5DO/kBkwMoPxJTuJkC0Y7TyYgtTqlYU3/57uP7Ux3sr9HVOK9nVnnvqca2x31O 2VKMFOTYPEoNyVKIOQF+lAF/wnsEIgq+kL0M0xWjsdb7VzX2tKqBN4TQ0A+vvWIPomiq 5znJ7sawAaSmC8VROvdSCpVKGAQnMFuGhulgPWuaCh+r8128hGrNr+VpvTaZR0cHJd/s Iwgg== X-Received: by 10.66.218.135 with SMTP id pg7mr42552631pac.141.1441609366811; Mon, 07 Sep 2015 00:02:46 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by smtp.gmail.com with ESMTPSA id j16sm10726565pbq.23.2015.09.07.00.02.45 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Sep 2015 00:02:46 -0700 (PDT) To: internals@lists.php.net References: <20150827173432.GA71000@3006.local> <28.A5.59944.15C7CE55@pb1.pair.com> X-Enigmail-Draft-Status: N1110 Message-ID: <55ED368C.5010209@gmail.com> Date: Mon, 7 Sep 2015 00:02:36 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <28.A5.59944.15C7CE55@pb1.pair.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] [Concept] Class Constant visibility modifiers in PHP 7.1+ From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Funny you should propose this now, I was wanting this feature just the > other day. This would be a useful addition, and clean up a strange > inconsistency: why can methods and properties have visibility modifiers, > but not constants? Private and protected methods and properties are private for a reason - they may be radically changed or gone when the code is changing, and thus external code should not rely on them, and the way to ensure it is to deny that code access to them. However, I have hard time seeing how that would apply to constants - they shouldn't really change, and if they do, they either shouldn't be constant, or something in your world changed fundamentally (i.e. scientists discovered that PI actually equals to 4). I wonder if you find in your code constant that you need to hide because you foresee it changing - should it really be a constant at all? -- Stas Malyshev smalyshev@gmail.com