Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129151 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 76A0E1A00BC for ; Sat, 8 Nov 2025 17:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762623819; bh=Vw/4WkR3mvvl9EUYwZyWcRx63NMiNmjtnhefDtgJKwk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LuHF1QzvM2u5eAHhQ0Hr5jnpiZP4dprGGm+oHoSgCdpAEdYnIMS6qUhOkdO/HgrSn 5zq9ONZPh3LJOUgPX1lzLkyPmbp97q2AQH3dcG2yKa+W+W3rvN6JbAz0LbCN2v6szX GkFPfPWMWtqOFWTlgLULwbS3uMaSv6as76iJ4+Z8tIEzW9DSqXU/f853GEJu/gGMod ae0fXUfwQAgpJYbw1fk1k6cRulycGttPprQWBgvsBAOYyML5JWJlYywPNgAw9cz3OA xsJVgdhoWnXRbjeq6+DU9RphxsTz8suv7+eZ8hvG+aW4hhVjkN1AV/UfV1Op1eqDp6 /6M70lBslyM5A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 75FD018003E for ; Sat, 8 Nov 2025 17:43:37 +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=1.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_INVALID,DKIM_SIGNED,DMARC_MISSING,HTML_FONT_FACE_BAD,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_REMOTE_IMAGE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from sender4-of-o54.zoho.com (sender4-of-o54.zoho.com [136.143.188.54]) (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 ; Sat, 8 Nov 2025 17:43:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1762623809; cv=none; d=zohomail.com; s=zohoarc; b=SWCVZR9zpxizFI9nA3HFgyEtyyYaRWEX9bsnkUMcBU4R8XZJy0loiToEHCw7Bgvv4uiCvrv6zbMLT57wpdKkG5WVIRnsvBMJcg8ckDae1GM6YjfctsoR8sFiA8F1jVO925yKpc19L50aJBIBW/WjTtW+CVYZi2FFznMQXgx1FB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762623809; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Vw/4WkR3mvvl9EUYwZyWcRx63NMiNmjtnhefDtgJKwk=; b=XGTm+LXkpAN5QjyIPG8yYPpfHdtVt6o8w1uEHamf3L2zJNkwxrdPisFDVUpvboQZC4adxTOIR0lwBz/NXgKu27WNP4TnP/Uk4odk89ObN/vHGFIV7Kktn2rlyh1wmzAe/6evRrx+HOWpuLi/4gqv0UiD0dOAOO2Vte1tstTA3OU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=faizanakram.me; spf=pass smtp.mailfrom=hello@faizanakram.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1762623809; s=zoho; d=faizanakram.me; i=hello@faizanakram.me; h=MIME-Version:References:In-Reply-To:From:From:Date:Date:Message-ID:Subject:Subject:To:To:Cc:Cc:Content-Type:Message-Id:Reply-To; bh=Vw/4WkR3mvvl9EUYwZyWcRx63NMiNmjtnhefDtgJKwk=; b=KoAME2nfhbk1UtKPR4CTC3enN0uoHlp59FwHaOZ/5zVIKBNS4cRNyeQ0jGqN4yIL eI9yKfSDw1IBMeV5eQA+KuHgWlw/j/Sk9fTbckulW8BZK+2BrYhtQcYdJpcc7356DJY gdX38jcL2BmhyskKW2zKlkOFO/GygRlRQoWpj7j4= Received: by mx.zohomail.com with SMTPS id 1762623806775442.29683590914397; Sat, 8 Nov 2025 09:43:26 -0800 (PST) Received: by mail-yx1-f49.google.com with SMTP id 956f58d0204a3-63e1e1bf882so1401206d50.1 for ; Sat, 08 Nov 2025 09:43:26 -0800 (PST) X-Gm-Message-State: AOJu0YzhtoH+PcsWlGoDHU+of43C0kqwIcTdam6KCMLoMgQki5FSom0m FQjxSMakijp0RQaoy9jDbLSk4HanS9u7fMbI5Ftkjz8BRdk9JhrCpNvLRBWqjlr3uBpqd7CPNLH gNF4OI6G5DvlpMr9lAt+mJzo/OnllN2w= X-Google-Smtp-Source: AGHT+IFXIUi0q9T19rtkx7F/eKROdI29+Edo0YIPYjA9IOvtVLIIHIr0N7NozA8ATVpBEii8W8E/QapSrZChMwhDIUU= X-Received: by 2002:a05:690c:4681:b0:787:c849:6554 with SMTP id 00721157ae682-787d5352888mr54170087b3.13.1762623806016; Sat, 08 Nov 2025 09:43:26 -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: Sat, 8 Nov 2025 18:43:15 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: AWmQ_bkka42ilLsE0n4hOtlPMvK9KSmpbOzjD1nPh-q-FuBpDLiokue5gtuJUB0 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="000000000000d492d4064318d555" X-ZohoMailClient: External From: hello@faizanakram.me (Faizan Akram Dar) --000000000000d492d4064318d555 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I like the proposal however the choice of syntax seems inconsistent. Traditionally visibility is defined by a single keyword like private, protected, etc, each implicitly defining the scope from which the property is accessible. Aviz (PHP 8.4) added the possibility of defining the operations that can be performed in the given scope like (get) or (set), the scope however is still defined by the existing keywords (private for class scope and protected for child scope). As such, I'd suggest to use a dedicated keyword for namespace level visibility like "internal" or "ns-private", the operations will still be defined within braces (). An excerpt from future scope of aviz rfc differentiating between visibility and operations. > At this time, there are only two possible operations to scope: read and write. In concept, additional operations could be added with their own visibility controls. Possible examples include: protected(&get) - Vary whether a reference to a property can be obtained independently of getting the value. (Would override the set visibility if used.) private(setref) - Allows a property to be set by reference only from certain scopes. [image: --] Faizan Akram Dar [image: https://]faizanakram.me On Sat, 8 Nov 2025, 14:21 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. > > Sincerely, > > Rob Landers > --000000000000d492d4064318d555 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I like the proposal however the choice of syntax seems inconsiste= nt.=C2=A0

Traditionally = visibility is defined by a single keyword like private, protected, etc, eac= h implicitly defining the scope from which the property is accessible.=C2= =A0

Aviz (PHP 8.4) added= the possibility of defining the operations that can be performed in the gi= ven scope like (get) or (set), the scope however is still defined by the ex= isting keywords (private for class scope and protected for child scope).=C2= =A0
As such, I'd suggest to use a dedicated keyw= ord for namespace level visibility like "internal" or "ns-pr= ivate", the operations will still be defined within braces ().=C2=A0


An excerpt from future scope of aviz rfc differentiating between visibil= ity and operations.=C2=A0

> At this time, there are only two possible operations to scope: read = and write. In concept, additional operations could be added with their own = visibility controls. Possible examples include:
prot= ected(&get) - Vary whether a reference to a property can be obtained in= dependently of getting the value. (Would override the set visibility if use= d.)
private(setref) - Allows a property to be set by= reference only from certain scopes.


On Sat, 8 Nov 2= 025, 14:21 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=A0= which proposes a new visibility modifier: private(namespace).
This idea has appeared several times in previous threads but ne= ver progressed to a formal proposal (from what I could find). My hope is th= at with defined semantics, examples, and implementation details, we can eva= luate it properly and see whether there=E2=80=99s support for moving forwar= d. Feedback is very welcome.

Sincerely,
=
Rob Landers
--000000000000d492d4064318d555--