Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127304 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 47A381A00BC for ; Wed, 7 May 2025 17:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746638339; bh=r5VpuXzPh8/T7aLXgMjH5pPYAK0Z2dk4Fq+MqvON0Qo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=d8U5i/ESvhg19988q2V9zUMYaKvBiLgPuqHZUa/c3bm7bhUbvVRAzjrO7MxNx/5vo WtrRKVgDv3kL44ZVBk69G/qXdxq9Te0l1yZaPDx/u2Mo/Kr7SYT3IjMFZI28/J14SD HGBY/7n6kdd1/B9PHHNkos5yNQFvyFN2hVTx283uPqzryrOKxDfcSWg7C7tXi1Daqm uvi8HDSvDqOWXiaVnIrhVUOTWwwqZdkcqlRUS9tGdyGyGzo9cJIFA4waxZWVmRtg4j K3Ba5PKmEFG1iug+K3re2FFsrCoX7m/MHI8M15WeMLHnUTdzXR8Cpx10M/MjgRInKx LGf6pusWpZFHg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3FB3718004F for ; Wed, 7 May 2025 17:18:58 +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,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 ; Wed, 7 May 2025 17:18:58 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 2D0E62540062 for ; Wed, 7 May 2025 13:21:11 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 07 May 2025 13:21:11 -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=1746638471; x=1746724871; bh=hI1bhc+EuRK79PTGQ1IpjM2Jh8IJEADJ9ousamfkSEQ=; b= StXARr+ZKhsX9R+4URlmmTmEJJvHDis1QuPr7NXOQjm3mQdNHvEJHa8vMkuC86WJ ZvA3nxmFanncWf9lNgfRn03CGWTuhGptYAtvV5EYguAbN882zZK8/h9o70/ERm5U KMCOGVjwp7p1JYo3LqL06LDnXq8gnNnjND0INKHIQctt16NeHWgRSohge1/doVKL c4P+Gkqi8tjriCjOMPyO9tmGQxK3p78VPj/9wzCJebD6UkFuveXrhkCJYsFTTj64 yFreoPixgMazmArIlU2oTKneYgQ+TckIQc0bUFu71qa6GlJze5QYZzogFEJrrtG0 DJtsqUrz0oserXn/F/7S4g== 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=1746638471; x=1746724871; bh=h I1bhc+EuRK79PTGQ1IpjM2Jh8IJEADJ9ousamfkSEQ=; b=JqiICMkFGsoiZxyT/ pgFPa0K0QQJEuykd8S/GS7swEf6/V460jDaf68IDdwmroZxX7VukGQn3QWAaHXuM txKJxdTDiMVaDQfKE4Kcyx5Zn3KS95LXiTD1dT6nHpOdSBVHhKo7WVuLS4vEoDG2 bLAxdjraV30exCNHtaskd4Uab7B+GFBNcPNSTo6uFFbDywhoIFYBzhhBuY1P3NjX D2ODPJWAk2j+JefJD9/DAHuQivVF3/iTrpAlL53Be/2QQXC66vDZtGXmMqnUVpjA Db5wIfOR/EWzl7dT2+yQX9NSKP2z/d15IGxrBSwQKR6RsfAlZr0q4UGujmMV/eno 9/S8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvkeejgeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeegtddviedvkeehheeludeuffekkeeutdeuudehleegieet fffhueeutdekvdeuveenucffohhmrghinhepvgigthgvrhhnrghlshdrihhonecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhh phesrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 7 May 2025 13:21:10 -0400 (EDT) Message-ID: <1069dc6f-a19c-4210-8b8d-03e2efa7b17e@rwec.co.uk> Date: Wed, 7 May 2025 18:21:08 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Re: RFC: Nested Classes To: internals@lists.php.net References: <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> <72ef8352-2afb-4024-b4ae-857fcd94edd6@app.fastmail.com> <213a8711-adbc-42b7-bcb8-86e64cb22cf2@bastelstu.be> <5A723310-1AB6-4D4A-88CC-52EC4E81AE5C@rwec.co.uk> <681845d2-ff1e-4ab8-97b2-50fecfdcb62b@bastelstu.be> <91B29E1C-EA9D-4BF0-8D69-42B43820F574@rwec.co.uk> <4943d4f939e61a72b41f9edacbf8eeca@bastelstu.be> Content-Language: en-GB In-Reply-To: <4943d4f939e61a72b41f9edacbf8eeca@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 07/05/2025 14:10, Tim Düsterhus wrote: > And rewrite all references inside of `Foo` to `Foo$Bar` (using Java's > name mangling). This is effectively what Ilija's proposal for > file-private classes did: https://externals.io/message/126331#126337. > I think this would also be nicer on the autoloading impact. Since a > private class is not usable outside of its container class, it doesn't > make sense to attempt to autoload it individually, since to reference > it, the container class must already be loaded (which means the > private class is also already loaded). I agree that this would be possible; I disagree that it is essential, or that it has anything to do with consistency with the rest of the language. I'm not even sure if it would be a good idea - it would mean having what appears to be a fully-qualified name actually "shadowed" by a completely unrelated definition within a particular scope. For example "\Foo\Bar" would still refer to "namespace Foo, class Bar" in most of the program, but "class Foo, nested class Bar" in the context of class Foo. If the visibility was changed to "public", the shadowing would instantly become a conflict anyway; and I can't picture how "protected" would work. -- Rowan Tommins [IMSoP]