Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109873 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48721 invoked from network); 28 Apr 2020 14:16:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Apr 2020 14:16:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 856E21804E2 for ; Tue, 28 Apr 2020 05:49:10 -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-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 05:49:10 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id e9so22591797iok.9 for ; Tue, 28 Apr 2020 05:49:10 -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=mxUOx9kfLxwZqxm4S2xIOD1hPdohshTtFogm7hQ95yQ=; b=pS2f5AxR1pCAGJFc3HTTO7JIPnLWswt+QGGDEJ/e98z+pDsN3EuivQ5Bn9fH4Md9lg rZkf1uUAecU9E9zHx3HlzVr4iDAk+hIOmFSHEo2n0RNJXlQJ24gEW6reYG7yyITj9FDb bg1KOgZPl5D0pfj8SEtGeHCFgs/xFW+UX+QbMNmC7SJ2gagVGpfCJNqe1e+eRSNk84/H VGEhEwXFqYZlc79OwtjocnK+1j4Tfo6VQ3eQI5S3lRkLQNgvtyVJ34/JsUhhSAUDEepS j03IWgKL2LW0LtC8Y7IhauE0/hNPSvkI9HVNQ+LE9EpnjnWEusQheSfzaX88vT6ZfTy6 uHtw== 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=mxUOx9kfLxwZqxm4S2xIOD1hPdohshTtFogm7hQ95yQ=; b=nlio2/LThF66bqLXDO1BheYrBHHs8ZJRmGHb26CCx4/k9HtT76VMMgvl0P4dejd6H8 /NuEhkUpz/+w5sP58op2tYUoxARBIx76VYUvu8htBcM12GK8wvur9WMjxYd4fX9VaHUo 1O4j60gmCsJp0GjXFZDuG5/OW/SgRnvOh1GJssYNIRSIYxYAwAosDKInod8ETvE/DDK0 OP3xX7f7qngQtGPjHtz9Qf60OwP+Gnb2OsZFczpjTBi2Inm713Z8lz43TPHzpuRBlkph ZqVDSxLEGS9ILkkn6ZaVBX8XtMzyWLiyRTZR9OpeHFU8gvzR0M69656SfEFuHAGW/6Cu 95IA== X-Gm-Message-State: AGi0PuacsfuM0Q/SMMyowRZUuKeytms9j1J9JPVMRxhkJGen+b5bH/ka B0JlMv1bBTUf5Nk0n4LBb5MxpVTBDbHtHpJgmDW8irF/ X-Google-Smtp-Source: APiQypIpPrqMkUVkhl0pZB+vtKOOTBSEhfVqRWfZbw2vjmABJAw5ysQV0lh4lmyMFtAcWWt81e/MehGe9SrcPgPoo6E= X-Received: by 2002:a02:966a:: with SMTP id c97mr25462206jai.106.1588078148428; Tue, 28 Apr 2020 05:49:08 -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 13:48:56 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000e9aa5705a4594154" Subject: Re: [PHP-DEV] [RFC] PHP Namespace Policy From: rowan.collins@gmail.com (Rowan Tommins) --000000000000e9aa5705a4594154 Content-Type: text/plain; charset="UTF-8" On Tue, 28 Apr 2020 at 12:52, Max Semenik wrote: > On Tue, Apr 28, 2020 at 11:45 AM Rowan Tommins > wrote: > >> 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. >> > > There's also SPL, with classes like SplEnum, SplBool, etc. > Those particular examples are part of an extension which has never made it out of "experimental" status, but you're right that there are some like that in core. To be honest, I've never really understood the concept behind SPL being its own extension, and I certainly wouldn't look to its naming conventions as any kind of precedent for future code. Some parts should probably just be considered "part of the language", and their names aren't prefixed: * the various Iterators * Countable interface (why is this in SPL, but ArrayAccess not?) * the various Exceptions * class_implements, class_parents, class_uses * iterator_apply, iterator_count, iterator_to_array * ArrayObject (although its value is debatable) The functions which are prefixed feel like they shouldn't be: * spl_autoload_* (autoloading is a core feature, and using it with __autoload is now deprecated) * spl_object_hash and spl_object_id (why do these need a prefix if the class_* functions don't?) Some of the functionality which is prefixed would be better refined into more complete APIs as their own extensions: * SplFileInfo, SplFileObject, and SplTempFileObject are an incomplete I/O system that doesn't work well with the rest of the language * The data structure classes (SplQueue etc) have various problems, and the new "DS" extension aims to do better That leaves a handful of things which are prefixed but could probably be removed without anyone caring: * spl_classes (no idea what the use case for this would be) * SplObserver and SplSubject (anyone proposing these now would probably be pointed towards PHP-FIG) > > >> 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. >> > > I hope it's not too late to change this before 8.0 is branched? > As far as I know, there's plenty of time. Regards, -- Rowan Tommins [IMSoP] --000000000000e9aa5705a4594154--