Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88079 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70380 invoked from network); 7 Sep 2015 07:29:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2015 07:29:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:40070] helo=ns73.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/54-40368-6DC3DE55 for ; Mon, 07 Sep 2015 03:29:27 -0400 Received: from RoLaptop (cm135-167.liwest.at [81.10.135.167]) by ns73.kreativmedia.ch (Postfix) with ESMTPSA id 05933DCE8086; Mon, 7 Sep 2015 09:29:22 +0200 (CEST) To: "'Joe Watkins'" , "'Stanislav Malyshev'" Cc: "'PHP internals'" References: <20150827173432.GA71000@3006.local> <28.A5.59944.15C7CE55@pb1.pair.com> <55ED368C.5010209@gmail.com> In-Reply-To: Date: Mon, 7 Sep 2015 09:29:18 +0200 Message-ID: <008201d0e93e$e86742f0$b935c8d0$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQD+fKoOEwUv0v7YlLGOvdoe1r3qNwEwjlLmAmPEyRoB40XxVJ+pxtpw Content-Language: de-ch Subject: AW: [PHP-DEV] Re: [RFC] [Concept] Class Constant visibility modifiers in PHP 7.1+ From: php@tutteli.ch ("Robert Stoll") Hi Stas > -----Urspr=C3=BCngliche Nachricht----- > Von: Joe Watkins [mailto:pthreads@pthreads.org] > Gesendet: Montag, 7. September 2015 09:15 > An: Stanislav Malyshev > Cc: PHP internals > Betreff: Re: [PHP-DEV] Re: [RFC] [Concept] Class Constant visibility = modifiers in PHP 7.1+ >=20 > > However, I have hard time seeing how that would apply to constants >=20 > I don't see what their not changing has to do with their visibility. >=20 > It's not hard to see a legitimate use case for private constants, a = case that springs to mind is where you use a public bitmask > for some configuration option but want to keep the shift or mask = constants private, because they might change, and you > don't want to leak that implementation detail. They are still constant = at runtime, but over the course of the life of the > codebase they can definitely change, and, they shouldn't be a static = member or normal variable. >=20 >=20 A common use case where I am using private constants in other = programming languages is to give magic numbers a meaning without = exposing them to the outside of a class. Seems legit to me. Cheers, Robert