Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126796 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 C663D1A00BC for ; Sun, 16 Mar 2025 21:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742159957; bh=d9yrTG7/8zdint06CQnMBk8Do535OrS8FeSAU+5AI4Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=A1mqbY6YeI9jb7/Y25Zgsc/yLErgxSivJCFQ4vu6OUQMlRTxVcyF8pCnSLrc1o+yB 4FzFhADjvmJoeVvcMamToiNCn1OKTAs2Sfp4y7whDk4AFdjn1gVL4WiPlV/yuuIhf7 RI/lmU5YSHOOyQotUQbsrPPbEYLhfntkbiSmkcNISADgQSHcUNJgprswyVUYwL6fi7 1jESBlb1oqg9blTaaeXaImekZj/I/Rr2fAgLxM4ZmD38tt7SWOurVRMOwRceFQMeNY 0BwHOAkeYkHrtsIxyyEg4WWvaADU9E0KTA1os/dKdwxdxx32EwCbVJh4qvYlkM6XW7 crGPRS9Yj9v+w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9490D1801DC for ; Sun, 16 Mar 2025 21:19:16 +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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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, 16 Mar 2025 21:19:16 +0000 (UTC) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso721411066b.3 for ; Sun, 16 Mar 2025 14:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742160107; x=1742764907; 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=d9yrTG7/8zdint06CQnMBk8Do535OrS8FeSAU+5AI4Q=; b=cUXWONnIsGj46Fcw4BO80M/I7hondC2/jDjjh80npXPoiIxcv1McnqXicWgXbCOmoY 4gl0rtyYKJyPsMmFWaJ9F+SkIY4xy0q0zW7ozXOoqg5ev7QRFHR7s0XWmABbzgiGjovw U78/C6F2FttFtHOHdM72bAidYvdcY+NmC7sHaj/UCKxHad0yzIZ39vJsahAMdYdGqNIZ r5iOO2H/4w7a9503YgWcIZNphA1zj54fg+EcdRq5Qd/0frCt3mxJEpB/G/kPgSneZwna 0VaUlD0CjJwBS3jlcF7QOyH99RU3fEuiFdT3v8TRcI4ync4YHjFKy7I51SKcXuBI0OsT Fcgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742160107; x=1742764907; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d9yrTG7/8zdint06CQnMBk8Do535OrS8FeSAU+5AI4Q=; b=cHeFeYFvU4vZlug6uHa87z5MF/0jxmmKG9jvA+UDXCU6P5dKXT48maCjzgn2ReGTSE m72TDx9SvbJUZqwDN98rXNX3BPVn+CLf0i4mEjJguGC+HRi2pe9muR9Iv3p28vD30S9n b+RkZo7C4tuGZ9GR5TJDxjiflhSZIrRkhbVJUtL/jyILzwviz6U+DOueoyTIi+xXKcxn r9GQL6vEto1yjDqyuPJJK8YEYIE2PsRz7b0GpXeEhtv919NlecJzz60QQZJRRRCA4+pN nNFbIVFnfxC49HIvHDlPEc3H3J1B3EIfGU1L276qHtEmQdkqBPRxfIxzk+Q9uf9Hz+CG fF1A== X-Forwarded-Encrypted: i=1; AJvYcCXQcjZbyFqpq/wa29anttuKiDBlNt/+pOOgu2HqQo7Uv2JeF0UvXw+QaD7IGE/lFA5NC2m3JBJShsQ=@lists.php.net X-Gm-Message-State: AOJu0YzIhn1JpivQ/mog2AgIZHNDO0nwPgtbet6HElviZoLeWLdPvQKf hfhkGwZIwlSSwJb/lgvTYvrtPAUwWbRW3Fwp5K3HBOy5/5sVr4BBLsNA2jM7D9E5tTB/GQzE1c0 TakDLVXIWLNxNA6JjbTPewc2HGr8= X-Gm-Gg: ASbGncsSmgPKlwL/W0alNZ32L3c6oB5P4Qi1pJMjSrSMmlFN9qzne4sE6roRTRuoijM Q26YhXZ+jDDFdoO60U90SeTIdK4tBm7KOWTPEd2nKcaZPjN5/DJbzeuUMbHkxBxV9Vf3zAlKuuR eUmpksckmFF0F4V6ExQ1gPmMQI4g== X-Google-Smtp-Source: AGHT+IGm77P39mQLNBLJF9zKVYPUJ8jk15g3J7sTeTuZLKdf9woWB7prk4zt0KQErN68KTAgUOKBqPoboAJtWV7fNCU= X-Received: by 2002:a17:907:6ea9:b0:ac0:b05:f0c0 with SMTP id a640c23a62f3a-ac330108d42mr1110006066b.1.1742160106893; Sun, 16 Mar 2025 14:21:46 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <4abd7008-ae33-46fe-8bbd-7c99f7c48158@app.fastmail.com> <0F1E4400-5E26-4E39-88B9-ABD7ABBAEBC4@rwec.co.uk> <1E14CA0A-0612-4D6B-8D50-5DEA0C546F3D@gmail.com> In-Reply-To: <1E14CA0A-0612-4D6B-8D50-5DEA0C546F3D@gmail.com> Date: Sun, 16 Mar 2025 23:21:35 +0200 X-Gm-Features: AQ5f1JqOxpxWBu-l8E5GdaC1O2zBjoewbn2J-X0Vcimfh0YECc3YTPz6ksxLWLk Message-ID: Subject: Re: [PHP-DEV] RFC: short and inner classes To: Claude Pache Cc: "Rowan Tommins [IMSoP]" , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000503ef906307c42af" From: i.miroslavov@gmail.com (Iliya Miroslavov Iliev) --000000000000503ef906307c42af Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Claude, exactly! By using '::' you cannot distinguish between a class and a function. So this is not an option because it leads to a headache. Just my 2 cents On Sun, Mar 16, 2025 at 11:08=E2=80=AFPM Claude Pache wrote: > > > Le 15 mars 2025 =C3=A0 12:53, Rowan Tommins [IMSoP] a > =C3=A9crit : > > > > On 14 March 2025 23:37:08 GMT, Rob Landers wrote: > > I could get behind `::`, but I feel that it introduces human ambiguity. I > don't believe it would introduce compiler ambiguity, but as a human, I ha= ve > to hope the programmers are using a style that makes it obvious what are > inner classes and what are constants/methods. > > > As far as I can see, all four languages I looked up last night (Java, C#, > Swift, Kotlin) use the same syntax for accessing a nested type as for > accessing a property or method, so we'd be following the crowd to use "::= " > > That said, I think they all also use that same syntax for namespace (or > equivalent) lookups, so the same argument can be made for "\". (Why PHP > separates those isn't entirely clear to me.) > > > According to my archeological research, it was originally designed to > reuse `::` as namespace separator, but it was finally changed to somethin= g > else due to ambiguity between static class elements and namespaced > functions/constants. See https://wiki.php.net/rfc/namespaceissues and > https://wiki.php.net/rfc/backslashnamespaces (where `::` is assumed to be > the namespace separator). > > =E2=80=94Claude > --=20 Iliya Miroslavov Iliev i.miroslavov@gmail.com --000000000000503ef906307c42af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Claude, exactly! By using '::' you cannot distingu= ish between a class and a function. So this is not an option because it lea= ds to a headache. Just my 2 cents

On Sun, Mar 16, 2025= at 11:08=E2=80=AFPM Claude Pache <claude.pache@gmail.com> wrote:


Le 15 mars 2025= =C3=A0 12:53, Rowan Tommins [IMSoP] <imsop.php@rwec.co.uk> a =C3=A9crit :


On 14 March 2025 23:37:08 GMT, Rob Landers <rob@bott= led.codes> wrote:
I could get behind `::`, = but I feel that it introduces human ambiguity. I don't believe it would= introduce compiler ambiguity, but as a human, I have to hope the programme= rs are using a style that makes it obvious what are inner classes and what = are constants/methods.

As far as I can see, all four la= nguages I looked up last night (Java, C#, Swift, Kotlin) use the same synta= x for accessing a nested type as for accessing a property or method, so we&= #39;d be following the crowd to use "::"

That said, I thin= k they all also use that same syntax for namespace (or equivalent) lookups,= so the same argument can be made for "\". (Why PHP separates tho= se isn't entirely clear to me.)

According to my archeological research, it was originally desi= gned to reuse `::` as namespace separator, but it was finally changed to so= mething else due to ambiguity between static class elements and namespaced = functions/constants. See=C2=A0https://wiki.php.net/rfc/namespaceissues=C2= =A0and=C2=A0https://wiki.php.net/rfc/backslashnamespaces=C2=A0(where `:= :` is assumed to be the namespace separator).

=E2= =80=94Claude


--
Iliya Miroslavov Il= iev
--000000000000503ef906307c42af--