Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129180 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 14FDD1A00BC for ; Sun, 9 Nov 2025 20:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762719946; bh=oUmDdP122QnxGM8fZ/2MHq4ydLtLoVUOkC2YamxpHtk=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=DthaZC9yJvwfe2lGoxW4D6jCvCNygo9v/85r0bLQVKEIXOyz6JtAogX1Af1N00E3q PJ+imZAl1/FoEiP2/mxynUCGvB89KElGDtT7sxWBp5CHf+3q1p0JT5wSExsGfKgE0q NZhJuIq+8O75TqiO1emXpGZpi6aqeiWyZ43OZFFqCEVW/ZOm4/m8xmqSKXl8c1gmqa 23sTs6FpHjHQfHvsQYeHbMtqIwRIia2doqNuTXpFGXUtlh7RPFzxvfFeTBhqvLltRi Fi4GotphOtwWEIDxNPVLZbCiU4gS7pVbKLj5qQHOb6u3zDxeUe24BUPpn2k/i7EtYZ /zStKZX9KMQZg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BBD3C180057 for ; Sun, 9 Nov 2025 20:25:45 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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, 9 Nov 2025 20:25:42 +0000 (UTC) Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-8823fa3bd95so7800026d6.1 for ; Sun, 09 Nov 2025 12:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762719937; x=1763324737; darn=lists.php.net; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=oqJiZvUUw/zFh3b9GnfmEkIIBITJfIabem48kwMTTV8=; b=i72+kxDIKqaDXm0orC0dlWzUqBBpxWeFYWja3XQ2O9ynQP8fEzjD1RiKbiTDSp5l3k aKlFibNp0iBmbOAWQUxN8lh5B2lp9mrPuhilSZoh6mvfLaQpyrKVxGKB5i67V8/VCCz6 Wj6L7GSOHw09iwD5CjAD7MYLDB+cTz7pXa9UFh8DkLlHPPOKE58SejXqsMJP11S/xxNl WoxeA/CkONOfEo6paD1rYeVtBrsdf5oVDWgXXlLi3gReNJR23ByxMOA2CNlX2/dNEvjz M3sDTJxo2vYJLSawZb2+MI6i8GXfEmHofJM6YNG0LttGvF+evRVY34m1qt6BGRbJDpsd WqvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762719937; x=1763324737; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=oqJiZvUUw/zFh3b9GnfmEkIIBITJfIabem48kwMTTV8=; b=bz1lHiChzs4yq3k968es6fcaqBR9ZYu22yLXLA0snl2uq8+mwrtE/fOdoC8cjlFP3O T9YgXo/uoCDrrxbvRbTyGnOxWky8D/12J/BbuaZpMhrU/ftevh9tKkR6/M0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 2002:a05:6214:2428:b0:880:5126:1e20 with SMTP id 6a1803df08f44-8822f345fd7mr116655146d6.0.1762719936598; Sun, 09 Nov 2025 12:25:36 -0800 (PST) Received: from smtpclient.apple ([2605:8d80:680:8a53:98e9:7f49:8b41:180c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-88238928a80sm36445466d6.9.2025.11.09.12.25.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Nov 2025 12:25:36 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] RFC: Namespace-Scoped Visibility for Methods and Properties Date: Sun, 9 Nov 2025 15:25:25 -0500 Message-ID: References: <475570ea-ff3f-4eb2-bbe6-8f86760ac5e3@bastelstu.be> Cc: Rob Landers , =?utf-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , internals PHP In-Reply-To: <475570ea-ff3f-4eb2-bbe6-8f86760ac5e3@bastelstu.be> To: =?utf-8?Q?Tim_D=C3=BCsterhus?= X-Mailer: iPhone Mail (22G100) From: volodymyr.volynets@gmail.com (Volodymyr Volynets) Hi, Did we take into account prefixed namespaces. private(namespace \Users\Auth\*) function test() {} And then Auth folder has other classes and folders with child namespaces. Sent from my iPhone > On Nov 9, 2025, at 2:56=E2=80=AFPM, Tim D=C3=BCsterhus w= rote: >=20 > =EF=BB=BFHi >=20 >> On 11/9/25 20:41, Rob Landers wrote: >> class P { >> private(namespace) function x() {} >> } >> class C extends P { >> protected function x() {} >> } >> This behaves the same as overriding a private method with a protected/pub= lic one today: the parent=E2=80=99s method is private to its declaring class= , so the second example is allowed. >=20 > This is unsound. As we have established, neither `private(namespace)` nor `= protected` is a subset of each other. >=20 > Specifically allowing this breaks the following (everything is declared in= the same namespace): >=20 > class P { > private(namespace) function x() { } > } > class C extends P { > protected function x() { } > } >=20 > function f(P $p) { > $p->x(); // legal, because f is in the same namespace as P. > } >=20 > f(new C()); // breaks, because C::x() is protected and thus not legal t= o access from f / the global scope. >=20 > Best regards > Tim D=C3=BCsterhus