Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127185 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 F129F1A00BC for ; Thu, 24 Apr 2025 15:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745507922; bh=WLDEU6Mw+3yOqfcYNtVxvNbCHOomXvYXa1LTjJVWYU0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ZhZj5OFGhfRGSqli1fYZVj9ZE5ZHqeFWVSckeCsXuHZUnBhorn7MU+if/bvcHY7jP sW+3aXq3z8KUkCkvkplJ6Tsf9lxcsfQlcYCI3DDA41HKKJgK13rBsyhSD9wTmu5dhm +eSvHL+DFaxX+Ii9vVWaCiJlF71G1BorTOF8o8TFTCeHLf35hsyfl1ZbC3XwkjGQOc sgDkJ6zk/hQgG4vHNLeZ/2OifmgHGvQtRy/Ul2qCGINtpFceMFG6zCGJv+9GBvAMoI XIgeLNAswlZEnUv19L4noKLfAyqW0/3yvQNOuu2UNP/sCSvtGxMrVnp07SmO/n6DnS uZW/pPQLaOzrw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 219B918007F for ; Thu, 24 Apr 2025 15:18:41 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, 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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1745508057; bh=+H8YxnrysQH7cQGL4lvcc4q0iOyaCATe86ZEVW2JQsE=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=O/1EOKg/1P9esHKwt01Z0FbsJt9/BriKQCJBImQ3z0TgngaVc/rvA/947XL7D1l1L 42g+lHTRmCCUpFd+5AGnyHD74qrJ6nLZw9nwEF/h3U64+qAEr5sLeshshT1sM4yE+/ zS5hYv1J7KgwFdTvSIKhXClGCht+1iGo90O2K6eLfWaHKnQ+fTXyKntgsClP0WTDCr Nr9DZ6HpPL8SpJ8+0lH155JUpWJM+Xw3u76pYIUM8YRHfN79AnsB01mVccSbzdiLvr tG0sJXOkxmhPCw7H8PdQtFv2C83QpwujfQeNH7jip9sBM1WGgSNMv8Nv4Z53mRmhCQ 5mDoZ3BGTmP5A== Message-ID: Date: Thu, 24 Apr 2025 17:20:56 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Re: RFC: Nested Classes To: Rob Landers , internals@lists.php.net 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> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 4/24/25 17:09, Rob Landers wrote: > 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 would end up not knowing which one was being referred to. That is a design error in the RFC then. > Also, it is worth pointing out that private symbols are *not* "invisible" or "non-existent" from outside classes. They emit their own errors: https://3v4l.org/PEGeA that indicate you 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 Fair enough about the error message. You can also access them with Reflection or the Closure hack. They are nevertheless ”non-existent” from the public API PoV: https://3v4l.org/Us6VV bar = $baz; var_dump($baz); In subclasses I can “redefine” private properties or methods and they do not interact at all. Properties have separate storage locations and can have differing types. Methods do not need to have compatible signatures either. Best regards Tim Düsterhus