Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126795 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 2043C1A00BC for ; Sun, 16 Mar 2025 21:05:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742158959; bh=gkOtLR7vmgk3m1n0guHyPkOe25du+QT7vBt5GVjexUQ=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=lxW34X4KdVx/j1O3NE865/JZoglda2yiM3ynowxFx8LzEb9ywZldtpmRimKMJDOrl i5gk9tLbwDYFPpevR9nilJvTQvc7lGpmaJXwy/jPWl6smuUO8PR0VuqtJxwGK2aOad Us0YVj+3rKYkPOcnLNqrMjq/GMw1vOgBSgVCfzjMwXdNXdFbG0m9wDKgCKKY9maEWW Rrjd3sYfSXbNU1DXEiULNwWvdwx4DMXo+oSKLsXxUlsbNqpYJTbrApjJ6R68T2bZSI qHA9BeyJ+NfnsriZkUUzdSRygufzMTmS4XCRsFEBmQWXGoIZe/SzAX71hPYZwiDCjJ Mcs9Q4qkrUlyA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7CC521801DB for ; Sun, 16 Mar 2025 21:02:38 +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.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,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-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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:02:35 +0000 (UTC) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-ac298c8fa50so706049266b.1 for ; Sun, 16 Mar 2025 14:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742159106; x=1742763906; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=cS9NSfJ8B5aA7Ys66KiMDmEMUCiV52D25vdBWIpo/vw=; b=PQehCDbXAggKp76OlRprMUOsk97VmizDhJnOtmvP3znozlxh7HezLb2p7PNkK8+e9T l5uYzkeM/F888ttFBsgVt9T7xpyjw4uFB/gp8bDMyr5ZREuqpWfGvBciWHoayTlJcvzh mRX3c7kSGnTCn7Iev1wAj1EoYTg2BUwsfZi6QJWSdpnXLqsBaFA6kJQYPifPHnosHET0 9cqUyn1r5YRW4i6ueBU62Z66LI4Sq+mzAnD68xhfwnM71gWo4vyD5bUtU97XF/jMx4us AXBdpLzf1APbdsvNY+nVqTk/SeBBp0YMM7bW9+58wOjDdM8DNx9gUml1OVNznrI+JjM8 Hudw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742159106; x=1742763906; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cS9NSfJ8B5aA7Ys66KiMDmEMUCiV52D25vdBWIpo/vw=; b=kHR0GIOgAtuLzCQZ0FKRDtYihIWG3NssBGrrb87AUsKNi4mIcL6/WR//BgbDXee4jp 6iy2Ff0i1Fqtun3A+CgMSDio8xg1Rcn2LLx8AN0YDuM6ILy4lHJ+3H5Fg+TScPcN2dMm 6XK7bujSyJRzPnZXQYfG0W7vjxHjAPMI5HZCaWkz3aJp314qsRYjaIcranhqQhXJUOd0 +BnxoLM1ddSQ+nR2ER9CXyiu3j9j+8n3ZP6OcbEoFyEP+j+Kvp8UlpeOztsmFCmaJsgD 4iNwBe+qcYRaL+H4yPVniXCkqZZnnA6krJYdBxrvz24jOz7G1AIO0iFyg9IE8ghe+d1U ixGg== X-Gm-Message-State: AOJu0YzAiNr/HkcmwYzcSA1W5f5cs9PzvoGY0gVhdECvZ33BHKRvXn0j dAhUb3UBNIkrdTmhTxgX9Yd/d8E8fLtY1K26rWKz5leDleRvR5C0sBDDew== X-Gm-Gg: ASbGncsoXXIdY0yRU+4UyK5n0VFDn/dOe/TMI4OwNkgi1dxQysrjS1MIsQByJYC0bsL NkNlWuneT6NHkavsFdv3+fG3H5LIWRm6qfWwMrZpL/uhDmPBMbjL2Hy0mW/gdRgHYvuvqjnMRvc b626yEWKWtdDoP+kaRt+M6A+nUQPqLcZqxTPNMpaE51yQE32ey47n3wS+pUPxHE4i19S82nSJJX HreBGvq2AHclv1AebpkYxeEAG6RtUsk4w3IMWJsrVFpKcsFuVMjTqNjk44kKxoBuUtTFxRcT8Yi O10NclXZp/lqpn2JZmzn0Mv/udvexCQ27SpAWbG57MtVUuxrkq7zEgf5U7TLJrrQrxg= X-Google-Smtp-Source: AGHT+IGb2EYBIMdXydcgupHJxwOSNhdGyHtTboh5UG5N1gi0qfHZ9cq+ERFNP9zt1GifDaOLX1DuMg== X-Received: by 2002:a17:906:4541:b0:ac3:45c0:6d08 with SMTP id a640c23a62f3a-ac345c074b8mr661380566b.0.1742159105697; Sun, 16 Mar 2025 14:05:05 -0700 (PDT) Received: from smtpclient.apple ([178.197.199.87]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3146aea76sm546206766b.32.2025.03.16.14.05.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Mar 2025 14:05:05 -0700 (PDT) Message-ID: <1E14CA0A-0612-4D6B-8D50-5DEA0C546F3D@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_92496AE3-1E72-42E6-8CB1-A6AE830EB5AC" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: [PHP-DEV] RFC: short and inner classes Date: Sun, 16 Mar 2025 22:04:53 +0100 In-Reply-To: <0F1E4400-5E26-4E39-88B9-ABD7ABBAEBC4@rwec.co.uk> Cc: internals@lists.php.net To: "Rowan Tommins [IMSoP]" References: <4abd7008-ae33-46fe-8bbd-7c99f7c48158@app.fastmail.com> <0F1E4400-5E26-4E39-88B9-ABD7ABBAEBC4@rwec.co.uk> X-Mailer: Apple Mail (2.3826.400.131.1.6) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_92496AE3-1E72-42E6-8CB1-A6AE830EB5AC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 15 mars 2025 =C3=A0 12:53, Rowan Tommins [IMSoP] = a =C3=A9crit : >=20 >=20 >=20 > 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 have to hope the programmers are using a style that makes it = obvious what are inner classes and what are constants/methods. >=20 > 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 "::" >=20 > 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.) >=20 According to my archeological research, it was originally designed to = reuse `::` as namespace separator, but it was finally changed to = something 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= --Apple-Mail=_92496AE3-1E72-42E6-8CB1-A6AE830EB5AC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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@bottled.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 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 something 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
= --Apple-Mail=_92496AE3-1E72-42E6-8CB1-A6AE830EB5AC--