Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123770 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 12F571A009C for ; Sun, 23 Jun 2024 23:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719184756; bh=6ZxLVbHysySN25Az/jU0RCREdkJInfVP1QuS/g2ZCOM=; h=In-Reply-To:References:Date:From:To:Subject:From; b=DAPFPEKnsh0vPjlsleDym9IZmBi1hLsYscsgCPMxi8Qag6DimyyovyZkD7noYKaSj mIqbA5wQPZhTWKe1uuREM7qCIthFfN6pop12l08uhVaV6aQigVhLYH2/Ipqo4qFl2G pbWibdSbsnfuQaEqlYi8UuFTrzXEbAo4lsgHp2qM1zkgwET3/H7p+chj/nJv4dbZPV KCMQoezSYeRAmW56SvBHaDoM6VUL4mTPvf8MRQ1foe4j5EbnUHueb/A69IiB+NFk2G aiox4vi4RU6ZLFHw9DO8XzbNWo1ues+Z4aqykqTn43ryDaY5aEP5+Sch2jF6a2DYxE qfjAj58F2qq/g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BA5A4180068 for ; Sun, 23 Jun 2024 23:19:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 23 Jun 2024 23:19:15 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id CD52C1380117 for ; Sun, 23 Jun 2024 19:17:58 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Sun, 23 Jun 2024 19:17:58 -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:subject:subject:to:to; s=fm2; t=1719184678; x= 1719271078; bh=7bh4VVZ30pUpHClmtB9hsbPGuQp5yVSl4b5FYu5YnDA=; b=F DzpqNsi3F8mSpBZXDI59s6BjDWgGcgZE/9iFwVJvQiC6iDC3gVnANCkZHgoMem3m n2NorA+TPUsAEJ/y205wOpDqCm3dSSY3oPvmzwzE51KkbPeTxmalsdD24nri6v/K pawqHSYpTQRMxJS4dKWNFKyyIxbMCeMJESJkHgNKaWloDsA0Qgv2PfWwHb6bn8XV ZusjKPrSwdsoqmAqJLvzTCv/AaKaFqW2IiiSW4F/rwTIU+j+gt1bDC1UHDWv7R7k WjnnO+k2EndOy6b61nxVkycJ/GUVejV6nn5oYPgt6SAK1ervCAYjyc5eI4kRIgTm bl3DTrVw+Bw1AYEH1N6KQ== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719184678; x=1719271078; bh=7bh4VVZ30pUpHClmtB9hsbPGuQp5 yVSl4b5FYu5YnDA=; b=DDmfDQKtZFauqQL5dDoKlSyyArj0bcotL9+29WWzN7SV UA3Ey3M5p2v2BYDuHLwWKEONylaNRP9ZmwHFBkPjpqoNGhggXBOFFgn2zOpq7lw/ vSBiCnJjIr9TTMQjFD84rUjtRHo58sBWH9Iku+mNV5qsxLVYth50ncgofI/QEEfF d1xp8qF2vusPnV/iixub5mry+juedaORYRDeJygnTWrPTJoJ32V3bryx6oq7U0AJ kvLspGrVcBq3D5ALgdulV88W8L+6kuFGIqEAz//+3iFo/6QmBMKs2KmADn//OpTM qJGW929rdiuQFubXffcTJoIrbMeArdFW3h3bWJJidA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeegtddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 76DEC1700093; Sun, 23 Jun 2024 19:17:58 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-522-ga39cca1d5-fm-20240610.002-ga39cca1d Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <7a22c689-86da-4399-ae89-23f17822c4a5@app.fastmail.com> In-Reply-To: References: <2a6b92eb-d5e9-4a1a-9548-a068ac42ebd2@app.fastmail.com> <02ee8831-43a0-4857-886e-7f54fb42a99d@varteg.nz> <7c9e97d3-3d3a-4e91-9eeb-2d460310befa@app.fastmail.com> Date: Sun, 23 Jun 2024 18:17:38 -0500 To: "php internals" Subject: Re: [PHP-DEV] [Early Feedback] Pattern matching Content-Type: text/plain From: larry@garfieldtech.com ("Larry Garfield") On Sun, Jun 23, 2024, at 2:14 PM, Andreas Hennings wrote: > This leads me to a different question regarding property guards. > What if we validate an object property guard, which later changes? > > class C { > public function __construct( > public readonly Point $point is Point { $z: 0 }; > ) {} > } > > $c = new C(new Point(0, 0, 0)); > $c->point->z = 5; > > The second operation would violate the guard condition. > However, I suspect that the operation will not trigger any validation > for a guard where the object is referenced. > So it would be up to the developer to only use this if Point::$z is > readonly, or they cannot rely on the guard. This is future-scope, so we won't delve into it too deeply. But the general idea (for me) is that a property guard pattern compiles down to a set hook on the property (or equivalent). That means it would apply to all writes to that property, unless you deliberately bypass it using reflection. So it would be no less (or more) of a guarantee than an equivalent set hook. --Larry Garfield