Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128377 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 lists.php.net (Postfix) with ESMTPS id F24581A00BC for ; Sat, 2 Aug 2025 20:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754168282; bh=i1pipwj5Jy+2rsLyrJ12IxBVgKa2iUPLXborxPoKEVs=; h=Date:From:To:In-Reply-To:References:Subject:From; b=WlqEtv1BNrGWDqjbnuIqRFS4Q/dsRABbZsfDAZFVb9IVxPTgNwVYv9ehR5u2xn0qr zyvQvqCaOcjxKDfHIUaBx0qrpfgh+TmZK4EQgkgBQuJvautlrMxVdLI32rFVOi2mEG aLAN6mTbCFk3Oo5ZoW7zUV+0Sn8MtsZm7ExzdxFbuplKA/cQEf9214xjZHbbjtGMpD AZfA790KJiUUbMFXx+mTJ8rgnsRDxxfHFizrUzqGCZhQbPajyv4a6LaszY1M/iyVYl 4SguY0r7mgvDmJR5pSXXuAI/ZbmRu/Jq89zY4nAxgyD3finpWz9d32bHI5lA3ONfRu 9w87DykuW9+iw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 72CFF18007E for ; Sat, 2 Aug 2025 20:58:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (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 ; Sat, 2 Aug 2025 20:58:01 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id D181A1D002F4; Sat, 2 Aug 2025 16:59:41 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-05.internal (MEProxy); Sat, 02 Aug 2025 16:59:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; 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=fm1; t=1754168381; x=1754254781; bh=i1pipwj5Jy +2rsLyrJ12IxBVgKa2iUPLXborxPoKEVs=; b=iWLu2BGfIp3QGgGMj7vtF56FH9 y8zNxFgANguAgCKFMusgO8zUt1alasJVhZsnjS+R+i9C8cQbj+GWvM5vPruDudel Dk1Iy/kPc5oW92kqLrtNBQG3Nlmzdnr/4eedUbYMi9oytEYGpO3YKhyLeuyZzkhq 2XTJaCsu5hvqCqo8oxM6nrHvJscdXmvLq9TKZUfFa0r+xV9G+fOLaAGz9+BRuxyI +YEg4AL3S+OPPsA7CIeT2SuKB2U6ttdlvjk7CNhcUa3fwjxedYpM3MiCyAe10YHr qPjCSlhDn0+y3OkJ1OvdaNEM/RIOcYCc5GoELwkqvJ51kcQo/zv93F4LuSmg== 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-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1754168381; x=1754254781; bh=i1pipwj5Jy+2rsLyrJ12IxBVgKa2iUPLXbo rxPoKEVs=; b=aBelqvVBQGyjHvX44BsX6GQyWAEAvlTwt2CR2MrVwkW9Rr8O/tz ugq4I7BKvJ1Wkikzx6IvBqnbmAwEMmodGGlUTVp9X0AILtq0Jebyv+TXXMxj51Q6 s8z9TdLsvBopubqxtVpiwzk03gU5kpW5i4qPwgnFKkwkeSKYdbgMVShri9A53pwV IEAbt2Sy2NxEGW+m3Qz7PDqLM3RadYAr5b8RNouRYcMhODE3VsloTAq7a0eE3Dgt +OzF9ATTzTh0/7RHaiP06bIhTZ+1Ma79t/oVhhouB1WRAkclPwQApnJkZaenWqUm oA2G6+SHss9q198I9G3P/VHoGkOMeZWsueQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddutdejheelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtsegrtderreertdejnecuhfhrohhmpedftfhosgcunfgr nhguvghrshdfuceorhhosgessghothhtlhgvugdrtghouggvsheqnecuggftrfgrthhtvg hrnheptdeujedttefhueelhfdtleeiudetlefftdduleehffegtdeihefhleeijefgveeg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhhosg essghothhtlhgvugdrtghouggvshdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhht phhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth dprhgtphhtthhopehimhhsohhprdhphhhpsehrfigvtgdrtghordhukh X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 45F551820074; Sat, 2 Aug 2025 16:59:41 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: ApgyNlIcRpMw Date: Sat, 02 Aug 2025 22:59:20 +0200 To: "Rowan Tommins [IMSoP]" , internals@lists.php.net Message-ID: <86af366e-5a31-4f0b-9440-a1d052b97331@app.fastmail.com> In-Reply-To: <43428CE0-2D9C-485C-969B-5529850614BE@rwec.co.uk> References: <2d516e15-2fc7-4ac4-b9c2-7146ac01cfb1@app.fastmail.com> <8c60c0b8-8826-49a4-80ba-973ff833fff7@app.fastmail.com> <900d2936-6afd-4eed-b08a-1540d124273a@app.fastmail.com> <43428CE0-2D9C-485C-969B-5529850614BE@rwec.co.uk> Subject: Re: [PHP-DEV] Protected inheritance hierarchies Content-Type: multipart/alternative; boundary=260be6d8f3064c7e9c44014969192cd1 From: rob@bottled.codes ("Rob Landers") --260be6d8f3064c7e9c44014969192cd1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Aug 2, 2025, at 22:33, Rowan Tommins [IMSoP] wrote: > On 2 August 2025 20:12:59 BST, Rob Landers wrote: > >I mentioned in my first reply, there is no way to get an instance-lev= el property unshadowed. It is there though (according to inheritance.c, = if I=E2=80=99m reading it right, it is still accessible, just not from u= ser-land). >=20 >=20 > I'd be interested to see what code you're looking at. As I showed in m= y last email, there's an explicit difference in how private and protecte= d property names are mangled, and it's consistent with how reflection, s= erialisation, and debug functions output them - which is that there is o= nly one property, no matter how many times in the inheritance chain it i= s redefined. >=20 >=20 > Rowan Tommins > [IMSoP] >=20 If this were the case, then creating a base class with default values wo= uldn=E2=80=99t be possible. The memory exists and is set aside for that.= The child class shadows this value, but the original value still exists= . You can get to it by calling into the parent class entry and accessing= it that way. There is no way to get to that value from an instance in p= hp, though =E2=80=94 from the perspective of the child, shadowing loses = the original default value. =E2=80=94 Rob --260be6d8f3064c7e9c44014969192cd1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Sat, Aug = 2, 2025, at 22:33, Rowan Tommins [IMSoP] wrote:
On 2 August 2025 20:12:59 BST, Rob Land= ers <rob@bottled.codes> w= rote:
>I mentioned in my first reply, there is no way to ge= t an instance-level property unshadowed. It is there though (according t= o inheritance.c, if I=E2=80=99m reading it right, it is still accessible= , just not from user-land).


I'd = be interested to see what code you're looking at. As I showed in my last= email, there's an explicit difference in how private and protected prop= erty names are mangled, and it's consistent with how reflection, seriali= sation, and debug functions output them - which is that there is only on= e property, no matter how many times in the inheritance chain it is rede= fined.


Rowan Tommins
[= IMSoP]


If this were= the case, then creating a base class with default values wouldn=E2=80=99= t be possible. The memory exists and is set aside for that. The child cl= ass shadows this value, but the original value still exists. You can get= to it by calling into the parent class entry and accessing it that way.= There is no way to get to that value from an instance in php, though =E2= =80=94 from the perspective of the child, shadowing loses the original d= efault value.

=E2=80=94 Rob=
--260be6d8f3064c7e9c44014969192cd1--