Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109867 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14089 invoked from network); 28 Apr 2020 10:12:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Apr 2020 10:12:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 17CE41804C7 for ; Tue, 28 Apr 2020 01:45:31 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) (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 ; Tue, 28 Apr 2020 01:45:30 -0700 (PDT) Received: by mail-il1-f173.google.com with SMTP id i16so19486749ils.12 for ; Tue, 28 Apr 2020 01:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4BQWOgmYi94J0u6PmMeRAvAAlJQka3ExrHVVqhlNXPs=; b=FYSMQ/VY20lIu5zdNykrIe4KI/BZWb6jUkTetvdI/B5m+Mp+5dPCq9yS5YHvBKGjrd Z4dWwyqIqLmsCJpPbPz969hdSTHw0qxf7XHrg5CcgH8zI3Bc8gKSwBucSSuvdxL/+w9d DeHhIznSm9sWbbYIqlse4RTn23rQTG1+a4PFcoIc7SIoE/Sn2vPIDdHlfhZW0n7yctUU mnocM0mH0uY1WmxQA3U+fki/JfQzdQGB1Z/XVvxQq9K7usu+oUfYUW3D2lNW0QLJrGLZ jP8CNJBmlZXcwj9y1v2MNsXmfUOhN5T5xlmrJlHK3G285fbHXlJtIMqZpGhrvyLcBnXC ZEKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4BQWOgmYi94J0u6PmMeRAvAAlJQka3ExrHVVqhlNXPs=; b=dXKdQSpmQ023AiDKJN2VAaGXuZPFL4bHVWaiCAjHAG1X26VKCcQL+xVThJrDJi8ifS OCUeB6keaOoDqn+Kkb8QBQMUWYFxVq3fuzSD/MGOsx0Ym31ZZoI5mzBFGR2tZM/SDB8b ZmZQxeBhcdpTUlmQMhqNy1zyk0JZfsVG47sZED7D0BZVWTgXesdKvoWNS6SRpl28blVQ vQctb1AP/oLy39oJMeXKJhmhkT9+IBsa1kA5X3sA1e7MNaY5nGLoX5d+m/DfSr4Mi/Iz c2r9AIj25fgfEa+i/hwZuF48glCExov3rStntJZQ85HY/h7zttn9E9gOWW4E6mBUiRCC Km4w== X-Gm-Message-State: AGi0PubbMehavYww5kKfxJpIK738SAqdq7kpLwZo8yAsMXLxtgcq7AYD tcPCY5nQr2U0aznBesvoDePUSjdXGTUKhkfm3kztFwNI X-Google-Smtp-Source: APiQypK4GkA1g6jwU5omrAoToT07F3V9S3kWl7UxZUjHJ51+o4n9NzFJTT8wFzUFa3C/L2mZriNZq7QC0XkmjHJFKhs= X-Received: by 2002:a05:6e02:5cb:: with SMTP id l11mr25799899ils.236.1588063529661; Tue, 28 Apr 2020 01:45:29 -0700 (PDT) MIME-Version: 1.0 References: <5ea5e72d.1c69fb81.ecd6b.8d05SMTPIN_ADDED_MISSING@mx.google.com> <29bd50e0-51d5-e8a1-10c4-bf89d42124c3@gmail.com> In-Reply-To: Date: Tue, 28 Apr 2020 09:45:17 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000090fc3a05a455da53" Subject: Re: [PHP-DEV] [RFC] PHP Namespace Policy From: rowan.collins@gmail.com (Rowan Tommins) --00000000000090fc3a05a455da53 Content-Type: text/plain; charset="UTF-8" On Mon, 27 Apr 2020 at 23:22, Mike Schinkel wrote: > > On Apr 27, 2020, at 6:05 PM, Rowan Tommins > wrote: > > > > So you'd be happy with PHP\str_contains and \str_replace next to each > other indefinitely? > > Absolutely. The benefits of having a PHP namespace would outweigh the > lack of elegance above. > OK, on that part I simply disagree. One of the biggest complaints about PHP's standard library is inconsistency; adding more to that by putting what would feel like a random selection of functions (or classes) in a namespace is a lot more than "lack of elegance". The benefits, on the other hand, seem to be a theoretical saving of a one-off cost on the usually slim chance that the name we choose conflicts with something in userland. > OTOH I'm not sure why we could not have *both* \str_replace and > PHP\str_replace, with a plan to deprecate the former many versions from now. > Let me quote myself: > So either we need a strong rationale and a concrete plan to move all of those into the namespace, or we need a consistent policy on what goes in and what stays out. IMO neither a policy of "everything new goes in, but nothing moves" nor "we'll remove the old names in 20 years time" is a workable plan; we need something a lot more specific than that. On Mon, 27 Apr 2020 at 23:19, Max Semenik wrote: > All these prefixes, like PhpAttribute being discussed right now, only decrease readability. One prefix doesn't make a trend. "PhpToken" is a different case - it's a token of PHP source code, so the prefix isn't anything to do with avoiding name collisions, it's a natural clarification. To be honest, I'd be perfectly happy with the attributes RFC using the class name "Attribute", just as we use "Iterator", "Closure", "Exception", etc, etc. At which point the whole thing's a non-issue. On the other hand, I'd be fine with a new PHP\Attributes\* namespace being used, but it would be good to have some guidelines on when namespaces are and aren't going to be used, to avoid us having the debate every time. Regards, -- Rowan Tommins [IMSoP] --00000000000090fc3a05a455da53--