Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99481 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52244 invoked from network); 10 Jun 2017 19:24:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2017 19:24:49 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.196 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.223.196 mail-io0-f196.google.com Received: from [209.85.223.196] ([209.85.223.196:33796] helo=mail-io0-f196.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/F6-01593-F774C395 for ; Sat, 10 Jun 2017 15:24:47 -0400 Received: by mail-io0-f196.google.com with SMTP id a96so7630654ioj.1 for ; Sat, 10 Jun 2017 12:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Egn83o06wyzgcg8y6QUSGmJG9htbJlH12xbtroficBQ=; b=aNROyN5c0fiHpi4HcsaLQbrLphPd62fxMSxS8S4dJyvI84TXh0WvJLGMY2nV2fz7P5 J4bbOwLyPHTK5aGcXrFs7fRI5PPkThLsNylPG4rRB2Aj3Qxn9+FpNvOUwHvglBWgiPQx 7PbUiyEvkr54X3oxpEmeevnwTcWSnhK2UWXGKpg26sV9Qk6ZWg0+ooNqvA3qqKkVZd/k Xh9Yni64t4eyxt+Dy+qg8mM/by9MDEYAq8A4g1zfMqBtczQzlOraVyBT5YY90t3BE3v5 FHt/Z7AID+KMh5Nr1q4bF6BmhS9xcTSAcxVqUPSrWy4b1hcza6elSK8iUzEj0bDoCwHy Df1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Egn83o06wyzgcg8y6QUSGmJG9htbJlH12xbtroficBQ=; b=e8QSIYQ98/e22jRgolFPABO7DJdZB1142SFHfBXiytPCNexvadkiYaR76NPICzLkFI Q5SAUPzf2ixBFWSWTzsRyefZ8xH+mraTPGPMPLMJ2yvfFyGswuXY1uSAWi8cA3iAPC6G uFUzxTm9N5ZBgjl8bnLejKCQ/pEzDjSDauM2Ozz3YT9ywaawJk+SDqOdptGGVTuIBL1t gn/itkD1FfBuHybnW0tsKRK40xe5C0CXlGg0R4zkDvIY4yYiX1iSS7I4KeJqNTevDAv3 lt5WKt6UAmLBUzn7W+vaw+g0X4J5/ACdAOUFIGzy64n2h1HC9TXXsUwJVc5I8bprISJE 2K6g== X-Gm-Message-State: AODbwcBY6lBBw0EgH6rNJpI7w1y9vHY9mc52zA0D0/7EAZ4n3kULuzdr y+JMxNbGchY3QJB3YynhcDnPSkVgrw== X-Received: by 10.107.170.99 with SMTP id t96mr41320830ioe.113.1497122684275; Sat, 10 Jun 2017 12:24:44 -0700 (PDT) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.107.12.159 with HTTP; Sat, 10 Jun 2017 12:24:43 -0700 (PDT) In-Reply-To: <3515b508-4571-0d57-6b47-616cae0b0908@fleshgrinder.com> References: <990f6d85-e3ed-05a4-42e0-d3a279c0ebe7@fleshgrinder.com> <277f53cd-0e79-6fcc-fa4b-b0527ca525b6@fleshgrinder.com> <3515b508-4571-0d57-6b47-616cae0b0908@fleshgrinder.com> Date: Sat, 10 Jun 2017 13:24:43 -0600 X-Google-Sender-Auth: 9O5t9gmRLitKlpSJ2MPWcQdOKwI Message-ID: To: Fleshgrinder Cc: php-internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [Discussion] Namespaces in Core From: levim@php.net (Levi Morrison) On Sat, Jun 10, 2017 at 1:13 PM, Fleshgrinder wrote: > On 6/10/2017 8:54 PM, Levi Morrison wrote: >> I gave this feedback before but I'll repeat it. I support namespaces >> in the core, with the `PHP` namespace (with whatever capitalization we >> decide) to be reserved *solely* for things related to the language >> itself such as lexer, parser, etc. >> >> I am fine with other extensions using namespaces but should use >> appropriately named ones. Using the `PHP` namespace to indicate >> something is packaged in core is a poor decision. We have moved >> existing extensions into core and it would not make sense to rename it >> simply because it was moved into core because it's a backwards >> compatibility break. Similarly we've moved at least one extension out >> of core and it doesn't make sense for it to have the `PHP` name when >> it's not in core, but renaming it is yet other backwards compatibility >> break. It's simply not prudent. Instead extensions should be named >> after what they are, the vendor they are for, or some other name; this >> is the same process user-land packages go through and core should not >> be different. >> > > Thanks for that, much appreciated. > > This is exactly what I am proposing. Only things that are provided > directly from the PHP Group should go into the PHP namespace. Any- and > everything else should go into appropriate vendor namespaces. > > I think that you are considering e.g. array functions as not being part > of PHP, and that you want to put them in a separate namespace. So > effectively we would have something like: > > PHP\Lexer > Arrays\Array > IO\File > Logging\Logger > Reflection\Reflector > Strings\String > UUIDs\UUID > > I personally do not like this approach. PHP is the vendor of these > things, thus, it should reside in the namespace of the vendor. Same > rules for everyone. IO for instance is not a vendor, it is a particular > use-case (working with files) and thus should not go directly into the > global namespace. > > There is imho no reason to move `PHP\Reflection\Reflector` to > `Reflection\Reflector` just because we decided, for whatever reason, to > remove reflection from core and instead providing it via PECL. PHP would > still be the vendor of it. > > The misconception that I am seeing is, that the PHP namespace is bound > to PHP, which it isn't: it is the vendor namespace of the PHP Group. > > The PHP community at large has settled with this approach, and I believe > that it is a very good approach. It effectively avoids namespace > collisions and helps to identify the vendor of a particular implementation. > > Would love to hear what others think about this. > > -- > Richard "Fleshgrinder" Fussenegger > If we were starting from scratch maybe we'd do as you are proposing. However, there is absolutely zero value in these specific things being namespaced *anywhere*: - Arrays - Reflection - Strings - IO We already have established conventions and prefixes around these. Moving them to a namespace has zero value. I'm not sure what logging you are talking about for PHP. That leaves UUID, which I am fine with having its own namespace if there are enough functions, constants, classes, etc to support it.