Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118962 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49522 invoked from network); 4 Nov 2022 14:39:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Nov 2022 14:39:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B368818005C for ; Fri, 4 Nov 2022 07:39:55 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 4 Nov 2022 07:39:55 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A4BE05C014E for ; Fri, 4 Nov 2022 10:39:54 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Fri, 04 Nov 2022 10:39:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1667572794; x= 1667659194; bh=UgJwab4/nXR6z2PxZzYu5gh86Wi13Rn50Ch2kICZ2XI=; b=g ycH03/4cUaytVG9ZukOFCUMQIoJWRkGCvs0Mj0CZoIxTrc1mjAQ9wc9KVBBLKE2E Pb/K5kTdwAGZ6f7F06d1umOoCN98tMXdzoL+ZnwoSlszCg9kJlWTbhoXcih6fAnz ngT727ix6UX9fpBo/QxiVJnyOea4I8uYb9UcO9z3P1JgIu5HgfJsvHP9hiHfFF8G U7b/ZDiIFA5Ip2unHQokdRJWs9A2+c6Ey+03FBqq0sa6SiJX3DNci20toOEj5l5L +TjJBw31j8WCNv6ao2jXm870QVI3ELZX8lJJop/nZqViDhWsYn4m9e6Ex9GThkVz lIPdHJdGaLLte38LHk7kQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1667572794; x=1667659194; bh=UgJwab4/nXR6z2PxZzYu5gh86Wi1 3Rn50Ch2kICZ2XI=; b=QUadkNUqUsg+wyBGJvypBpVWxcIUh9uzJnO9O22odLYX Db2xzZQSbzjAVPQ75Y4KWaLBNUFRWEx3EufXiI3ZDT+UfP0oaFnXjsjkFF60bnVz Bkwo+yenndIckaWq/iSHKSCVehB6DdUzcPckY1AZwp1ma0uBHpV4PEtq5gQCpqnC oUzcJKV4DO/gr16nLBLtySeJq5CYw0BMOCXYIEYCdQld3ziM2WMMwGsHfV4pr7uP W28RcJ9Qo3aeeBtt9GhR3BIRz1uQZLyFaAJJvrsaBCr3rYYMDQTnDTk9SKcQx/B/ b/x+YAsUl1+mOcrWYUNIF4mQbPU2qm0o3rXPLJAtpg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrvddugdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffvufgt sehttdertderredtnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrg hrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnheptedu gfevfeeludduheekhffhvefhlefhvdeffeffuddtteduteeuvedthfehiefgnecuffhomh grihhnpehphhhprdhnvghtpdhtfihithhtvghrrdgtohhmpdhgihhthhhusgdrihhonecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhi esghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 65AC11700090; Fri, 4 Nov 2022 10:39:54 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1087-g968661d8e1-fm-20221021.001-g968661d8 Mime-Version: 1.0 Message-ID: <504f616c-05c1-45ef-991e-2b4c79f72d07@app.fastmail.com> In-Reply-To: References: Date: Fri, 04 Nov 2022 09:39:33 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC][Dynamic class constant fetch] From: larry@garfieldtech.com ("Larry Garfield") On Fri, Nov 4, 2022, at 9:31 AM, Marco Pivetta wrote: > Heyo, > > On Fri, 4 Nov 2022 at 15:26, Ilija Tovilo wrote: > >> Hi everyone >> >> I'd like to propose a simple RFC to introduce looking up class >> constants by name. We have dedicated syntax for basically all other >> language constructs. This RFC aims to get rid of this seemingly >> arbitrary limitation. >> >> https://wiki.php.net/rfc/dynamic_class_constant_fetch >> >> Please let me know if you have any thoughts. >> > > What's the problem with using `constant()` for this? > > Marco Pivetta > > https://twitter.com/Ocramius > > https://ocramius.github.io/ As it says right in the RFC: // This: echo Foo::{$bar}; // is way more convenient than this mess: echo constant(Foo::class . '::' . $bar); This is something people have mentioned a number of times with enums and dynamic case references, and seems like a good small cleanup. --Larry Garfield