Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128379 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 53D961A00BC for ; Sun, 3 Aug 2025 09:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754212118; bh=omapXMEtzSsx1ToMVUo1dvMZiVS7HAcXVcitISdUFXI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=QLWy3D/kpK8RPm8ltwtmiyoeu8Te3hqibk6XYWWLq136ZMixS0eP4YCTieum9G1xs x8UeAhryj2zaPSUZNXrUQsvdNRQ/dXzUDEcdpJzIktUkAhv5h8kuweIsVKPJVvARRh wU23QK1rOgJWBo1kjpFx4+nwhvbn7EeI3BQ1hG50/Uu4FGlwhJb8JwVYoPkqP6ZdPN /AXmjZDdBOqW/Qp0FFUYA/QNnWtVa0y0lmSjZYxyC6yEurj6UQdmsgInjGqxZj4o9M FrrvDRt6wzASm7rqzZB+goTTIC5CDbLqzFtEGFDTY51XgCnY4P5X2TiUuPu4T0RJJk js/J5r2PaTWmA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 158EB180081 for ; Sun, 3 Aug 2025 09:08:37 +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=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (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, 3 Aug 2025 09:08:36 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id DF73AEC1517 for ; Sun, 3 Aug 2025 05:10:16 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Sun, 03 Aug 2025 05:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding: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=fm3; t=1754212216; x=1754298616; bh=omapXMEtzSsx1ToMVUo1dvMZiVS7HAcXVcitISdUFXI=; b= Y7wzXI13wURSja0v6VpEmHZFfF5TIEkkkbqcXFOWuBTDw77+baRf/Lhh1JjUJnz+ zen3LJ3Qwz2klHD6aHhh1uHMCC7jz3SdEcKBEk+L2ZUx1F54iPZnWJC8HwYGe25F pPSBES03I4X00LG0/3kHQLMEFuS7jt+EnY2GgquCbo24Yd45AIN+BeXjpM4AN7NO 3GyD+mHq2fdClU4eLMuIbb+mVVbOL5ZDZBTsGx7ypmMmkmyfbt6xAmXSIIAZxt0g r/llmY8rRxhJxDrRXL2liiOSO27tOSwZtilWrnn8J+I2yrstRsI7bnatnC8IvHSG wOsHZiuanuuh/+zj1N8/ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=1754212216; x=1754298616; bh=o mapXMEtzSsx1ToMVUo1dvMZiVS7HAcXVcitISdUFXI=; b=OmzrfO0ilymM++f8v eOMb/HtpUaLyZXW9zALDWlQ4VbXq+VfEdc6iBDEWM0ExQvrtBgh3NQRZnelLAkF3 eXxvSGYHDbleQk0GflTI8Q06YrJluZpOkGiROUrL8HaLpTnn61XE1XQKpw1+/9Sp ZG4eNxkTZxjfWY8G2HwkHiJeQXHc8opEIKilP1bYMaTNSHS1G9uWNhuRi0r2lHFS jkSh4T7RKBbOO/hM5PibX0USRJodQDZysGkMwnwUo7ZlsTZmmGttT6He4n9SJBEA 2F1P+okDgiVVqi160KWk+WOmiy2lUCcukSviafl2Qt4pwOLR58BdNygNmoBj9Epi C9yig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddutdeltdehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmnecujf gurhepfffhvffufggjfhfkgggtgfesthhqmhdttderjeenucfhrhhomhepfdftohifrghn ucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtgdrtg hordhukheqnecuggftrfgrthhtvghrnhepueevleffieefgefhhfeujeduteeigeetteeg ffegledvhffhleevvdeijedugeeunecuffhomhgrihhnpeefvheglhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhp hhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtph houhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 3 Aug 2025 05:10:15 -0400 (EDT) Date: Sun, 03 Aug 2025 10:10:13 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] Protected inheritance hierarchies User-Agent: K-9 Mail for Android In-Reply-To: <86af366e-5a31-4f0b-9440-a1d052b97331@app.fastmail.com> 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> <86af366e-5a31-4f0b-9440-a1d052b97331@app.fastmail.com> Message-ID: <5C752175-C3ED-406C-B40A-84639358C24B@rwec.co.uk> Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 2 August 2025 21:59:20 BST, Rob Landers wrote: >If this were the case, then creating a base class with default values wou= ldn=E2=80=99t be possible=2E The memory exists and is set aside for that=2E Sure it would: the default value is just an assignment that happens at a p= articular point of the object's lifecycle=2E For a child class which overri= des the default of a parent (on a public or protected property), only the c= hild class's assignment will ever be visible=2E So it would be perfectly va= lid for the class entry for the child class to only store that one assignme= nt=2E I don't know if that actually happens; maybe the cost of de-duplicati= ng is not seen as worthwhile, and the assignments are just run in sequence = every time=2E Regardless, the philosophical question in this thread seems to be whether = re-declaring a protected property should change the "ownership" of that pro= perty=2E I think it's natural that a protected property *only* declared in = a sibling class can't be accessed, so some ownership needs to be tracked=2E What seems surprising is that the ownership changes if the same property i= s re-declared, especially since the new declaration has to match the origin= al (e=2Eg=2E you can't change the type), and every possible access tells th= e user the two declarations have been completely merged=2E=20 Intuitively, an identical declaration with no change other than a default = value looks like it would be the same as overwriting the default in a const= ructor, but that is not the case=2E (https://3v4l=2Eorg/5iIak vs https://3v= 4l=2Eorg/rL8pX) I'm inclined to agree that this is a bug, regardless of whether it's diffi= cult to fix in the implementation=2E Rowan Tommins [IMSoP]