Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114088 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73271 invoked from network); 21 Apr 2021 15:05:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Apr 2021 15:05:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 482BB1804D8 for ; Wed, 21 Apr 2021 08:08:19 -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=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 21 Apr 2021 08:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1619017696; bh=SXtsqA2AzscSPQx+C+sh4dzWltljze1UUy4E4qHK7lA=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=ESomllp0dxjvtV46p6qr6/mPxqTaE07kdzoY3bGto43BG7flfqX5i4vXL32JR5VYV XT+W4L8lWOTufBFem9eDQCyiS8FQvmHfWbqmZqukPiMFOHKRS8x6EIMOai82iz9lld EKdC5sXgvjNuOATT60wnqXJsYBTfxJPV0Kgts3HY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N0G1n-1lO8fP233X-00xIrt for ; Wed, 21 Apr 2021 17:08:16 +0200 To: internals@lists.php.net References: <004701d73549$6dbc9840$4935c8c0$@jhdxr.com> <00c501d7368e$922938f0$b67baad0$@jhdxr.com> <866BBB78-85D0-4C97-87FC-63E526CDDF9F@cschneid.com> Message-ID: Date: Wed, 21 Apr 2021 17:08:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <866BBB78-85D0-4C97-87FC-63E526CDDF9F@cschneid.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:GByBhILjNeVB+C4mLjB/a7AvWrnc8eh9ODIWNNoxbnWqzCINlfr rdRXJ+TfEAfOpiCeLZigZSAr7i6yKGc7S+byleAXtbbV7RabWvI/w9REgAHLJXzHp0DNG/E 9LknE8DkvC3R8oaZpYv+53d5FBvL14tQqlcGRcWE28p/4Z/VhF8aSsJMENVj3IAxElFQBOy KdHpDYGfntJyjK0F8kV6g== X-UI-Out-Filterresults: notjunk:1;V03:K0:gldEzc+fZ1s=:eb4HU5/2fqOexJ/ZQ81HAA 6zKZGUNDl97ysb/TrXJVzAdOzCaXQvdIeRe810l6F1bSntUetmsGVXTwOCA2aVOlnKTnKpB35 llc66pXYbOFyzO5++riTwvjoowHJUKI+Ot2GfhZ44G1YnrlBrZX7Ymf7OChrxpCimQPjMrZ9Z GbwA62G6Kojq8AO3h54NCt7Lv7VxaYHkKjcaDrrb/6H7g0rbj5zHj77kcAxaBYeFOdzLnY6VY CubGClyH2UPIUV+dBOopzxeKQy1i7frfyn40KHCvAvH8v4gFXNEFXtkIZiRvd2zPh6SSvlbVq IkCSkS+mBuZBD7lFdV4vyhycNtnJSyCRZbcB+jVUtzYbDd2OYLF0OpuddhSz/F6NfFP+le/uF LGOPliKBiAtn4LPRCmmdDejJ46d9HHhmnDoOnuQXimDVj0uAgF/qSmBq/N99ZuYbQEyOIgEBg mc52nUSXoepLPx6XaXokXWc4SD9DV1HgUeSxkI4Zeix5W7hzZMAOebcjVgBfshwn2AdfUVf/1 j6NnHKUGqStSX9GCJF7lhZoXAol9AUUVZo35ZafYr25McBdhgkJaK3KIxksv6jQzJpNMWP5lf Txuv08avFhpv2fR1xho0ju1dd0lWJ4BRLL+gd8ylrndchC8yYjxwbQYrTbGhGpSdgIPKEwnI8 dIo9WHIztbN3JJDstqaX5iGGOE0Dofku5jOazM6S98d4FA3aGHmaIfGzQex1DXhPcPYab/+sh h67CT5KnH18vLSghhzlLrYF/61wmv1EnOudgTp1gPnLqFZlJAwaUdjmzu7XbA2ac6sI19f5lK 63TmYVcLa0KCNXwRdDNEOQP1WFK8Xd8grDom7oWb/8dDOJGoVQrBDejS8tdsZwNRavApqKYOo TGgVcx8BmxdeZk5KCQjYOlUw6OYwGtiFRLE+LgDpiDAZ9iHLUhkCTmDhul3YCW5qpSeu9+eah 1rMcNsTN7wHh3nNj2+2wbVKSatHJP7EiRwRQuV6RxNLNo/mqSAtlVbuuacq1jMB0n9LBxYZ/R MY3o47kKDbwkQEqpGXLzPyelyFcimm9GCdqz++mvn0k5GAW58cf2NsXJGx+NeuuRqbQSoLP1Z /rnSMHN3479cKA3FvTvyLaDbxJ0FTsZt8ZLJIvLf3YY9xzhqTM0LGiYSJmhjZMnqSZvhwTxij b6Yf8j1NnsfAZJxX9wBRCUtV4wC77nfI6qjDeBfTUDXKzi0C5CE4GX9XCtr7PwZjQ0PGQ= Subject: Re: [PHP-DEV] [RFC] [Draft] Final constants From: a.leathley@gmx.net (Andreas Leathley) On 21.04.21 15:14, Christian Schneider wrote: > I never really understood the desire to restrict how people can use > your code. > If there is no good reason to override the value of a class constant peo= ple won't do it. > If there might be a good reason (even one you as the original designer d= idn't predict) then why not leave that door open. > > While I understand the theoretical benefit of being able to specify this= behavior I do think it is almost always counter productive and not a patt= ern I would encourage. Especially not in a dynamic language like PHP. Such restrictions also convey information and intent. One could argue defining a specific return type to a method is restricting its use, but it also clarifies how something should work and avoids unintended changes. final constants might be more niche, but it gives you a choice on how you want a class constant to behave if child classes are necessary and possibly done by someone else. Having "final" for constants seems a good addition to me, especially if the inconsistent behavior with interface constants can be solved at the same time.