Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118963 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51584 invoked from network); 4 Nov 2022 14:45:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Nov 2022 14:45:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4477D180044 for ; Fri, 4 Nov 2022 07:45:45 -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_00,HELO_DYNAMIC_IPADDR, KHOP_HELO_FCRDNS,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS16509 3.120.0.0/14 X-Spam-Virus: No X-Envelope-From: Received: from ip-172-31-8-58.eu-central-1.compute.internal (mx.maintaina.com [3.123.246.158]) by php-smtp4.php.net (Postfix) with ESMTP for ; Fri, 4 Nov 2022 07:45:43 -0700 (PDT) Received: from [192.168.111.85] (ip4d150277.dynamic.kabel-deutschland.de [77.21.2.119]) by ip-172-31-8-58.eu-central-1.compute.internal (Postfix) with ESMTPSA id E84078BFAB6; Fri, 4 Nov 2022 14:45:42 +0000 (UTC) Message-ID: <655a8d92-e691-3631-f8a2-1c083029766e@ralf-lang.de> Date: Fri, 4 Nov 2022 15:45:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 To: Ilija Tovilo , internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Dynamic class constant fetch] From: ralf.lang@ralf-lang.de (Ralf Lang) Hi Ilija, Am 04.11.2022 um 15:25 schrieb Ilija Tovilo: > Please let me know if you have any thoughts. > > Ilija That new way of accessing class constants dynamically does not really make things more readable for me. Maybe I just need to get used to it, but especially that last example would make my head spin without additional comments: Foo::{test('foo')}::{test('bar')}; Maybe I miss the use case. What kind of code would benefit from this? Wouldn't just using constant() for dynamically built constant strings be more legible? Maybe in a separate line? In the past I used a lot of flag constants backed by integers. A lot of these use cases have become classes/types in their own right since. When do you use these constants? Just my thoughts.