Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114085 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45546 invoked from network); 21 Apr 2021 09:10:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Apr 2021 09:10:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B66501804DC for ; Wed, 21 Apr 2021 02:13:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_20,FROM_EXCESS_BASE64, HTML_MESSAGE,HTML_OBFUSCATE_05_10,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 21 Apr 2021 02:13:30 -0700 (PDT) X-QQ-mid:Yeas7t1618996401t101t13235 Received: from 90373548D78A4F9A84016F99F658592A (me@jhdxr.com [155.69.198.11]) X-QQ-SSF:00100000000000F0FG1000000000000 To: =?UTF-8?Q?'M=C3=A1t=C3=A9_Kocsis'?= Cc: "'PHP Internals List'" References: <004701d73549$6dbc9840$4935c8c0$@jhdxr.com> In-Reply-To: Date: Wed, 21 Apr 2021 17:13:19 +0800 Message-ID: <00c501d7368e$922938f0$b67baad0$@jhdxr.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00C6_01D736D1.A04F8630" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHi46dfJ12ACkqZRUHCdTGM+mYT6gJ3DOLoAZYv3PyqhtjlAA== Content-Language: en-us X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:jhdxr.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 Subject: RE: [PHP-DEV] [RFC] [Draft] Final constants From: me@jhdxr.com (=?utf-8?b?Q0hVIFpoYW93ZWk=?=) ------=_NextPart_000_00C6_01D736D1.A04F8630 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Can I ask why you use late static binding while you don't want your = constant value to be changed/overridden by child classes? IMHO, = `self::FOO` is all you need. Personally, I don't use late static binding with class constants since = the coding standard rule I previously referenced forbids this, but I = don't think a coding style rule should be our only possibility to = disallow constant overriding. After learning about the strange behavior Nikita pointed out, final = constants would be even more useful than what I initially thought. I agree we should fix the weird behavior but that=E2=80=99s another = topic. My point is actually what=E2=80=99s your scenario for a final = constant? If you want to make sure the value you access are not changed = by child class, `self::` can serve the purpose already. If you want to = make sure=20 child classes can access the original value, `parent::` or = `ParentClassName::` can do the job as well. Regards, CHU Zhaowei ------=_NextPart_000_00C6_01D736D1.A04F8630--