Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129159 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 DA9B11A00BC for ; Sun, 9 Nov 2025 06:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762668587; bh=ojl96nW6AjuuSmmdmCyfSBEP9f5xHmHlDxloIM+Tc5w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=elOFUq7TqnYfqaPormnyg7UYPU7OH8vAspV5whH/vFGrIlTDXAjpNbRaPbetPX4QA aKnHrWs8qreTAx6q38mp0THaIg2xg1VScQDjgy1BOfgTxMo9x9nLX4429OsC+XWAlU mhHzUzwAnSDiOmdY0EreD5T0x7I4VUMuPICOgjL60IEhW0a6F0nT3tkKCu4y4qahmp ZKHIOkC98oMH+sLZ/sxgMmW1GyBwP/bCTQqbUA76NwBXfRqDwWjy25SG5ltuAi959q aj2AImZl/CcelRPrwz/LQvr3aunDX/jAsQ/yEIo0A6jQruFZ2XcKzpfR/K+fIHdmKT OchfNvLWg61vA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 716FE18006E for ; Sun, 9 Nov 2025 06:09:46 +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, HTML_MESSAGE,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-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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 06:09:45 +0000 (UTC) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-787eb2d8663so347787b3.0 for ; Sat, 08 Nov 2025 22:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762668580; x=1763273380; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ojl96nW6AjuuSmmdmCyfSBEP9f5xHmHlDxloIM+Tc5w=; b=noQRHee9/ut2ilth8PWH6+K3suY9QWKShzmhD0Rb8BHWXDy09DEUZUmkmbowxXU8z9 zoK49bm6KoWSRwDKdXQtbQxgwxUddhbYDV53ykgIfwv1MbhC7+siThpEnmE2v5vtk5Xd UYxgYQtEwAMNZfJkdSBSZ7N0N7L+bbnzvlw0hG5xuPw6WcKpmmLjRP51wSFdzfDAwl39 V6ML3P1rwYACXy9LJwpcpufvRgeFMaECJJQlow9o0lcx8C236EW38vauSzyG+du+i+EB MlooZdbX4Nr0xoc47zhIRB09euV5jYjETF6WMqmjCSLXyKA0apaZf+X73ejscyW2pLQh tOLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762668580; x=1763273380; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ojl96nW6AjuuSmmdmCyfSBEP9f5xHmHlDxloIM+Tc5w=; b=Vrb2Sm7MPRXHWnbLALhcnaYYADZnwjM79ljU3H/S0tTeRMcUcptow6kxHf435gLjbK sZG1QC2Ok/xzEgcvaDrkLiREMGs2hJM2vn0DI1LxHPIl/EGlG+hBhG9y5gBp7t/TiCJ2 9mhgcV5hQrJ+6b+Jb1EpwsGWdVskA0X1paE15apOHJjMPbihVE/44Q6Y/C0r2giavyiA xMjJg/BMvnjMyxx7UGBfpZxKINbwokc8XQ42GRUg17byMxEyGoNHPqb3lrdOa8rMnCvP 3d7OajleHoIBvJ/IGMqHLSAj0uK/1oNns4MoiNwvJJcnGEKkz6bzy6qkm2gYCjYyHYAp 7dYA== X-Gm-Message-State: AOJu0Ywr4uTUKC7w+EqzUqYfWIFRSKq8d1r02r9nopBGnJ/Qj3sJmvXX BO7tP0u+r5WXNBz2RbhMbh5ZAWY46+YKSH3d9oZFZs7BKupHrOBgx+k8B+TSK8zGJR3oRKR2loa Yz3gpPUQ25Eqrvn/CdKJK0fY6iybHpaQSFQQH X-Gm-Gg: ASbGncs2gr7sb6Vpufsw4rdI2r9DXXUAAC1JY7KGQ/MpK0xytuZMsI+g8nrkvLguQsj qAPW6tGQ68gO17d3x1QreNhxMZ4/lrYSUeM/H/Xk+GJUN3Y4dcpIdnakGAv7iGkC817qomJ43NV jiEetEzj7jvNTBi3aq4tXaoY9cQmpjeW38eynPKzVXCe8S9YMCD99cOArPkERrFsKQjz83ZGIdG IUmmyD+PXOz2OOfkogjwzHjtkSW/39C8uM3eul8pa9eBbjaUDcs9TSGI8k5AUKMYuAZYHHf X-Google-Smtp-Source: AGHT+IHM1okNnOoBIQV7nCo0Wn+Q/HxDgJ5HosA6izSmqO9Mbw9TnBPflqmTZjMUWlza+LbpzKJ7H0BQnQDVVsqfEcw= X-Received: by 2002:a05:690c:fd1:b0:787:badd:4f with SMTP id 00721157ae682-787cab63d6fmr67604587b3.17.1762668580163; Sat, 08 Nov 2025 22:09:40 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 9 Nov 2025 08:09:27 +0200 X-Gm-Features: AWmQ_blxb-C23Qd7WiWiqsQzjxrKpSqCIi2aNXsNd_zBy39y046X8AxdHA-fFtk Message-ID: Subject: Re: [PHP-DEV] RFC: Namespace-Scoped Visibility for Methods and Properties To: Rob Landers Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000093d3040643234272" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --00000000000093d3040643234272 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Rob On Sat, Nov 8, 2025, 14:46 Rob Landers wrote: > Hello Internals, > > I=E2=80=99d like to introduce an RFC for discussion: > https://wiki.php.net/rfc/namespace_visibility which proposes a new > visibility modifier: private(namespace). > > This idea has appeared several times in previous threads but never > progressed to a formal proposal (from what I could find). My hope is that > with defined semantics, examples, and implementation details, we can > evaluate it properly and see whether there=E2=80=99s support for moving f= orward. > Feedback is very welcome. > > Nice work on this. I have one issue: > *Visibility hierarchy: *public < protected < private(namespace) < private I think is not a correct view of the real problem space, as the protected and private namespace scopes are separate sets that might have things in common but can also be distinct. I think the correct way to model it, is to have two hierarchies: public < protected < private public < private(namespace) < private Otherwise you can have things like `protected private(namespace)(set)` that is unclear how it should be handled. Can you clarify what is the right-now expected get and set allowance for these cases: - child classes in the same namespace - child classes in another namespace - non-child classes in the same namespace My suggestion is to not allow mixing protected and private namespace for aviz. --=20 Alex --00000000000093d3040643234272 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Rob

On Sat, Nov 8, 202= 5, 14:46 Rob Landers <rob@bottled.codes> wrote:
Hello Internals,

I=E2=80=99d like to introduce an RFC for discussion:=C2=A0https://wiki.php.net/rfc/namespace_visibility=C2=A0which proposes= a new visibility modifier: private(namespace).

Th= is idea has appeared several times in previous threads but never progressed= to a formal proposal (from what I could find). My hope is that with define= d semantics, examples, and implementation details, we can evaluate it prope= rly and see whether there=E2=80=99s support for moving forward. Feedback is= very welcome.


Nice work on this.


I have one issue:
>=C2=A0Visibility hierarchy:=C2=A0publi= c < protected < private(namespace) < private

I think is not a correct view of the real problem spa= ce, as the protected and private namespace scopes are separate sets that mi= ght have things in common but can also be distinct.
=
I think the correct way to model it, is to have= two hierarchies:
public= < protected < private
public < private(namespace) < private

Otherwise you can = have things like
`protected private(namespace)(set)`=
that is unclear how it should be handled.
Can you clarify what is the right-now expected get and set al= lowance for these cases:
- child classes in the same= namespace
- child classes in another namespace
- non-child classes in the same namespace


My s= uggestion is to not allow mixing protected and private namespace for aviz.<= /div>

--=C2=A0
Alex


--00000000000093d3040643234272--