Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120921 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42447 invoked from network); 19 Aug 2023 16:55:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Aug 2023 16:55:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D9D071804D4 for ; Sat, 19 Aug 2023 09:54:59 -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 ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 19 Aug 2023 09:54:59 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F33A55C00E3 for ; Sat, 19 Aug 2023 12:54:57 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Sat, 19 Aug 2023 12:54:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type: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=fm1; t=1692464097; x= 1692550497; bh=nSS1RTmWTz1qani8boz7lld2S+h0RvBYVUX71ms99NA=; b=N 21Gb7h3dLoku/ykdmWjHgSh3srAiFaDzqJnxOJ450tb5kdnXOD4wSVb9hKp5Qioz NKJ5STjEnHBUhCHufbQqcAWpOefco3oAIIZz+0lc39KOwT3EKKZ4LI9q4ROyFDQf 2XBz+G26vKQ6X1twG5K4tfTFDA00ax1AlNTeILeXj00BBSb7mPB3q4VS4QnpqepM QGbF1oYSBUpLwi13rPl5taktVq9PPzSC7jz3JDzaPGF9w38ncfPUGPw8BVUgxYo8 BaqIY811Sql175SVni0GEQdGwv57dOtWc+FbaQ02Mt7m7LfxPp+QG77BX8jkJ1ez Ymkugr5zsy3cghhOnP2lA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=fm1; t=1692464097; x=1692550497; bh=nSS1RTmWTz1qa ni8boz7lld2S+h0RvBYVUX71ms99NA=; b=iPC0B8tTItdmWTqvEh7+1Ynrps7RE fD0UPphVHv41se1Z/YR5FoohuGZRnBiID0j0P/V96ZWZP0wPlnBO7pgaoUdH3fcs qTMRgy2verqF0Nr6no4+/A2VH+QVRpzHJZdPbulIOtwRNwX9WlpcS7RgA4sxGK7B Ldl2LidbqXtXNFwFu0jKdYJPXy51CfAjcBImsNguj3R5T4sinRfop0NLW001JVey zlxuFMBwi8vaA0dXNLv61DbIPMPliHnj+WQD+UBbkx2T18iXhqygm0IGahtAFERM iLfJd92cHoCQ6RC4zlfWC/qEn7NKKdUL+OkV8YmCyFkoaJMkogdao94dQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduhedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepjeeludeuffevveevgfffkeejtedvteefteejfeev vddugfeitdduvdegveevjefhnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpphgvrg hkugdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6B64A1700089; Sat, 19 Aug 2023 12:54:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-ID: <351a6a6b-bc4b-4429-8091-458ab194497b@app.fastmail.com> In-Reply-To: References: <64E00A5D.5010108@adviesenzo.nl> Date: Sat, 19 Aug 2023 11:54:36 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Access property of object stored in a constant From: larry@garfieldtech.com ("Larry Garfield") On Sat, Aug 19, 2023, at 4:21 AM, Claude Pache wrote: > At the time I filed https://github.com/php/php-src/issues/10497, I was > merely exploring the potential of the new ability to have an object in > a constant. The potential use I had back in my head was the following. > Currently, I store some settings in global constants. I was > contemplating replacing those by properties of a readonly object stored > in a global constant. (A fatal issue I discovered later in my journey > is that readonly properties can only be initialised by code inside the > class itself.) As a tangent here, that has a workaround: https://peakd.com/hive-168588/@crell/php-tricks-access-control-bypass Which I make use of in Crell/Serde, which is then used by my own config library to produce exactly what you describe: https://github.com/Crell/Config --Larry Garfield