Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109646 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70264 invoked from network); 15 Apr 2020 12:51:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Apr 2020 12:51:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E0CFA1804B4 for ; Wed, 15 Apr 2020 04:21:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 15 Apr 2020 04:21:35 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id i3so16652985ioo.13 for ; Wed, 15 Apr 2020 04:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=zpTKgzVCEUGkqyscH9XgRChuQ2I7uaLDQcFhEwK/3Uc=; b=LNEOYrOPmvN8fzEEdy5B31obaBAgCQWGtybG6McU+9np9cXY/tlHLETUbM4KRPDQKG Wb3lKb+GWGE+m+U2uX+BJLlUfQn2PaQQNv/x3ecfo88bZ52B/HXKiBmjGnQ1PEDmKIm0 AIiGa3DDwXqd87G59GVwLO+USSAAYGnFP7ZoIqm+xP9nfB9VFD/iK5ndPtZpMnB4hXM2 O1GfO94JeapAHYsNzMBNJxjBTh/Oc0ndkMxc8h4sMuq0pBaXQLHf9DfSYT1JaZPlOZNK IGR+/s4dEgjAsqg+w7Z/UL2/xOavnNXbvDDtD6ivxp9WLqxhPageg8uvKP9b4iEpBui2 hiMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zpTKgzVCEUGkqyscH9XgRChuQ2I7uaLDQcFhEwK/3Uc=; b=sXQBESvG4cz+WH92HIw4UNs16tq90wtUr4ApFGr2qD+WCgBiKvQlZ8TXD3cUhbM/AO mwLfOjVFkfZfQgfWertbh1GXZIAV49KAxfvKFNX7QQuYFh7UH+yASg+YMkay5H71WXfv JP6Pskhp3ymZ6bzF1rqPTwmiH3k7xm2suCb1SsyesqKQYiF8ovzYnY1o2N5Y97vUAxxM sAp7bK+nJcw4PwmlLKDnefdGoGW5pGIodLIwH6qmr2/NDmT04RASe1cdB+Xi9jph220P 3605eRzH5egdVnVrh4s//WWjsTW0p5kpFOQkrY1IKcALaFsgsq6mnrhwffA+jkPcq+rt 1rSw== X-Gm-Message-State: AGi0PuZ7bGQVIU7KyCQwWD9rmaekdSZnToJez3aNCdb2oU8wL6zToz/n 1PL5J0xKrEWdGyFMx8kzC6+LFtUpDp/MGYCAYJ5NGXlq4SE= X-Google-Smtp-Source: APiQypLBHN0j8zMf7h4Gf1liyspOA2cX35Iup3bSPrvfcVJvlU3D2ALML053LMHlI0yt5kuV5Vbe5lNUFkWBIrIRR98= X-Received: by 2002:a5d:91c1:: with SMTP id k1mr5449011ior.8.1586949693088; Wed, 15 Apr 2020 04:21:33 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 15 Apr 2020 12:21:21 +0100 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: [RFC] PHP Namespace Policy From: markyr@gmail.com (Mark Randall) Greetings, I would like to re-open the discussion on properly reserving the \PHP namespace for the use of the engine and its core extensions. Rather than seek to demand everything be moved into namespaces, I have instead written this RFC as something that would form a policy guideline for future development of the engine and those extensions which are directly managed by internals. At present, the accepted style is to "fake" a namespace by prefixing symbols with Php. As internals "claims" the top level namespace, this effectively means that all userland code must exist in its own namespace, which is indeed how almost all modern userland code is written, which if anything this proves the benefit of namespacing. In effect, this is both demanding a particular style, while choosing not to use it ourselves. Furthermore, based on the common understanding that a namespace owns and is responsible for all of its descendants, our current arrangement is that _all_ code belongs to PHP and that internals using _any_ namespaces at all could lead to a legitimate collision. Finally, the \PHP namespace itself IS already noted in the documentation to be reserved. https://www.php.net/manual/en/language.namespaces.rationale.php "The Namespace name PHP, and compound names starting with this name (like PHP\Classes) are reserved for internal language use and should not be used in the userspace code." This RFC would formalise that notice, and give notice to internals that the use of \PHP was permitted and encouraged. https://wiki.php.net/rfc/php_namespace_policy -- Mark Randall