Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91993 invoked from network); 8 Sep 2015 01:11:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2015 01:11:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.51 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.51 mail-pa0-f51.google.com Received: from [209.85.220.51] ([209.85.220.51:36805] helo=mail-pa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/25-34134-6B53EE55 for ; Mon, 07 Sep 2015 21:11:19 -0400 Received: by padhk3 with SMTP id hk3so23393308pad.3 for ; Mon, 07 Sep 2015 18:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QO+W7Flbb/DEcpYavPtkXvOxvG1sEAbeKc8IzohT1TQ=; b=BS3LT7ApLKb1I9EkTTrpE2vxtiougdaRRf2GEc1VsbqwAdRhPpxA+gTpME7epeCSP/ ejwYx095fD1P+pTbXETyJddfEz4F1znghVnLWVBLEjpQw2cvmvB8okoxPyvqDqOtpSOB OMm10QZV2gYdnsInYsWB8OV7gf3f+iGYGygbbbUEBjAbUtZ/yoo8s2eqQ0dY8FC8aCkU BSIvr0P2zx7iFUWak35nr42YQ2fTp55MLp3p7aKMy30zl5YJGcR+0etApUMMagbgJdyP SGCjAEjGZj3dZFBjNIwuNet+VUvq8mC3TAHozwHc6Ur84gHhtLBFNTF8FmckXihppKMQ c7kw== X-Received: by 10.68.236.195 with SMTP id uw3mr5762879pbc.68.1441674676020; Mon, 07 Sep 2015 18:11:16 -0700 (PDT) Received: from [10.10.0.22] (ec2-54-64-249-138.ap-northeast-1.compute.amazonaws.com. [54.64.249.138]) by smtp.gmail.com with ESMTPSA id nv8sm1115496pdb.92.2015.09.07.18.11.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Sep 2015 18:11:15 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (12H143) In-Reply-To: Date: Tue, 8 Sep 2015 09:11:12 +0800 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <7346C557-93DD-4E12-8E06-651D6A81A715@gmail.com> References: <20150827173432.GA71000@3006.local> <28.A5.59944.15C7CE55@pb1.pair.com> <55ED368C.5010209@gmail.com> To: Andrea Faulds Subject: Re: [PHP-DEV] Re: [RFC] [Concept] Class Constant visibility modifiersin PHP 7.1+ From: laruence@gmail.com (Xinchen Hui) Sent from my iPhone > On Sep 8, 2015, at 02:09, Andrea Faulds wrote: >=20 > Hi Stas, >=20 > Stanislav Malyshev wrote: >>=20 >> 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, >=20 > Why not? A constant's value doesn't change at runtime, but nothing stops y= ou changing the value in a new version. A real-world example for you: phpng c= hanged the values of the IS_* constants in the Zend Engine. >=20 >> 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). >=20 > Constants in code aren't necessarily natural constants. >=20 > 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? >=20 > If I have a value specified in the source code which will not change at ru= ntime, and which I don't want to expose as part of my public API... what exa= ctly do you propose it should be? I don't see why a constant isn't fitting. >=20 public static final as Java does Thanks > Thanks. >=20 > --=20 > Andrea Faulds > http://ajf.me/ >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php