Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127184 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 71A3E1A00BC for ; Thu, 24 Apr 2025 15:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745507250; bh=y1tFa1yXOCW77vuLzz86n1tcke8gdrNmG0zrbzHQRc8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=nXLsIcK4xuRXJ2RYE/6tMkCdBWagQpViebnnlSM/8t8crptv3R36mfy0rvARyi2l7 pVI3I1TjdQzIK5xjGC2J0qtu/zTb4+DnMeghPMxEoo7b91k+3W9nE3WBIenPGM3Me3 f6q3y+3JziDrUVE2vCwUU2V/+RgrarxNIjBoix/7ogS6H4dk3I069Jgue1N/6z2l5h CHXQNckrTOhKXyG3gy3wd7cDbss4yqrukFJseCpylm7RTDONs0WN5XheETFm0r8ACA tD+smfm6Oma+s/AU27aL6sF3KJhPobuSrj0BbnMwqpKWQGNCPGFMolxdMSIYqkn/99 M1SU5WY7pnUHQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E134A180080 for ; Thu, 24 Apr 2025 15:07:28 +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=-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.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (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 ; Thu, 24 Apr 2025 15:07:28 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id AAEF9254026B; Thu, 24 Apr 2025 11:09:46 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-05.internal (MEProxy); Thu, 24 Apr 2025 11:09:46 -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=1745507386; x=1745593786; bh=y1tFa1yXOC W77vuLzz86n1tcke8gdrNmG0zrbzHQRc8=; b=x1CHS8EFsmFvnm9gs3eQ6enjDV LuB+wk2mrV1EK03ob0M1CSYSk5ujANaePOPqVw3ErrttZjUouHDH06l6OkbiyhUd Bc13YTSHrmSo6B5giPrhyztccxpshrh4p3YYgxVbWqQO5l4cPXBgZ+8UKZP5GGx4 CBQ7mhcRoFZX+rZrn3ZsgClXy3LzODGlXzmQFpENOZmVFzg2QIeCNvs+7XmSoWve lmdXb9D7gG2Zy7RlZXan4EyriTSd8GSZdetgDn2sFYU35ChIuEGzmZvZudzylS+G CqYO/HmcI6sAeUcZJ2fiWDEbCwFzo8Jf5FQujey3EBLjkEbEpUiAiLDhlDOA== 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= 1745507386; x=1745593786; bh=y1tFa1yXOCW77vuLzz86n1tcke8gdrNmG0z rbzHQRc8=; b=NaEZyYb+zlYq9mo4GmHuExcyJzgzk9u76qWOpWPdQ5tcC44sRX9 cdbgDY7xTKvw26Rs97NPUhlwoIKc1STv33qSMtA1vNcMlWI31Y1xhOh6Ai4zb7R5 1nBOvsHWvAaND1vAMrJY6VmM/ixpFk/88k1jNW5fVjkY2mUX+BScFRr4F8f3p+et QJQ5Kub6pCIgSxf30szDlR89hXKllubl0vlm2VZNlIRz9eedMNCPuM7IT8jpVcS4 PQQPxSS+Hid0oTe87JzAJX6aaTrMiROmA2NsY36sOG4MRCNpsHu4+atHry9t0BC3 bQ2T7yWNoKvjtzEjD4awLPoOnLDbVWLJPsQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvgeeljeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgoufhushhpvggtth ffohhmrghinhculdegledmnecujfgurhepofggfffhvffkjghfufgtsegrtderreertdej necuhfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothhtlhgvugdrtg houggvsheqnecuggftrfgrthhtvghrnheptdeitddvvdevhfdufffhgeelffetgeffveek heekfeeluedutdeiveekvdetjedvnecuffhomhgrihhnpeefvheglhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohht thhlvggurdgtohguvghspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehtihhmsegsrghsthgvlhhsthhurdgsvgdprhgtphhtthhopehinhht vghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 1DAFC780069; Thu, 24 Apr 2025 11:09:46 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: Te5d7a0ed2909808f Date: Thu, 24 Apr 2025 17:09:24 +0200 To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , internals@lists.php.net Message-ID: In-Reply-To: <158a5d7c-8ef6-4b5f-b8ef-593879a7a896@bastelstu.be> References: <48dce917-d147-456b-9f03-c7e23411adff@app.fastmail.com> <8a16b81c-7dab-4523-a352-76ba0cb4e771@app.fastmail.com> <9c4ac301-dfb2-49da-90e5-37a2824fc4e3@app.fastmail.com> <5b1e6d70-a1c9-455c-93d3-6b22cf1fef11@app.fastmail.com> <52d84a5b-09d3-4e42-9620-a62fb239c21e@app.fastmail.com> <09a82882-f1ee-4bdb-8a27-e46144a711f1@app.fastmail.com> <706e22d7-94eb-44bd-a280-f629ba93b630@app.fastmail.com> <03a5b9a8-9fe1-4656-ab04-dd58669488b3@app.fastmail.com> <158a5d7c-8ef6-4b5f-b8ef-593879a7a896@bastelstu.be> Subject: Re: [PHP-DEV] Re: RFC: Nested Classes Content-Type: multipart/alternative; boundary=cf9161e508df4c35aa608aecede4a63e From: rob@bottled.codes ("Rob Landers") --cf9161e508df4c35aa608aecede4a63e Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Apr 24, 2025, at 16:31, Tim D=C3=BCsterhus wrote: > Hi >=20 > On 4/20/25 15:43, Rob Landers wrote: > > As it seems that discussion has mostly died down, I'd like to put th= is towards a vote starting on May 1, 2025. >=20 > Unfortunately I did not have the time to follow the discussion after=20 > mid-March, so this might or might not have been discussed already. I=20 > just skimmed the RFC and a big issue from my PoV is the interaction of=20 > private nested classes and the shared namespace. >=20 > All existing private symbols in PHP are =E2=80=9Cinvisible=E2=80=9D or= =E2=80=9Cnon-existent=E2=80=9D=20 > from the outside for all intents and purposes. As an example, it is=20 > possible to add a new private method to a class, without having an=20 > effect on child classes that already defined a method with the same na= me. >=20 > To my understanding this is different with private nested classes. A=20 > private nested class will =E2=80=9Cblock the name=E2=80=9D in the glob= al class table,=20 > leading to naming conflicts with something the user shouldn't even kno= w=20 > exists (because it's private). >=20 > This is a reason for me to vote against the RFC and a reason why I=20 > preferred Ilija's =E2=80=9Cfile private=E2=80=9D classes that are much= simpler to reason=20 > about. >=20 > Best regards > Tim D=C3=BCsterhus >=20 Thank you for your feedback! I think you would then have the problem tha= t was pointed out by Levi the other day; where you would then have ambig= uity. If you could have both private and public names in the same namesp= ace, then you would end up not knowing which one was being referred to. = Also, it is worth pointing out that private symbols are *not* "invisible= " or "non-existent" from outside classes. They emit their own errors: ht= tps://3v4l.org/PEGeA that indicate you tried to access something you sho= uldn't be able to. This is different than when you try to access somethi= ng that actually doesn't exist: https://3v4l.org/nWVPV =E2=80=94 Rob --cf9161e508df4c35aa608aecede4a63e Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Thu, Apr 24, 2025, at 16:31, Tim D=C3=BCsterhus wro= te:
Hi

On 4/20/25 15:43, Rob Landers wrote:
> As = it seems that discussion has mostly died down, I'd like to put this towa= rds a vote starting on May 1, 2025.

Unfortunate= ly I did not have the time to follow the discussion after 
mid-March, so this might or might not have been discussed already. I&n= bsp;
just skimmed the RFC and a big issue from my PoV is the i= nteraction of 
private nested classes and the shared name= space.

All existing private symbols in PHP are = =E2=80=9Cinvisible=E2=80=9D or =E2=80=9Cnon-existent=E2=80=9D 
from the outside for all intents and purposes. As an example, it i= s 
possible to add a new private method to a class, witho= ut having an 
effect on child classes that already define= d a method with the same name.

To my understand= ing this is different with private nested classes. A 
pri= vate nested class will =E2=80=9Cblock the name=E2=80=9D in the global cl= ass table, 
leading to naming conflicts with something th= e user shouldn't even know 
exists (because it's private)= .

This is a reason for me to vote against the R= FC and a reason why I 
preferred Ilija's =E2=80=9Cfile pr= ivate=E2=80=9D classes that are much simpler to reason 
a= bout.

Best regards
Tim D=C3=BCsterhus=


Thank you for your= feedback! I think you would then have the problem that was pointed out = by Levi the other day; where you would then have ambiguity. If you could= have both private and public names in the same namespace, then you woul= d end up not knowing which one was being referred to. Also, it is worth = pointing out that private symbols are not "invisible" or "non-exi= stent" from outside classes. They emit their own errors: https://3v4l.org/PEGeA that indicate y= ou tried to access something you shouldn't be able to. This is different= than when you try to access something that actually doesn't exist: = ;https://3v4l.org/nWVPV
=

=E2=80=94 Rob
--cf9161e508df4c35aa608aecede4a63e--