Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113247 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99440 invoked from network); 24 Feb 2021 16:38:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Feb 2021 16:38:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 122441804E3 for ; Wed, 24 Feb 2021 08:27:26 -0800 (PST) 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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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, 24 Feb 2021 08:27:25 -0800 (PST) Received: by mail-io1-f48.google.com with SMTP id f6so2580079iop.11 for ; Wed, 24 Feb 2021 08:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=5KwqJJQz+RqPo1AdQAAwWW+39onvGph3i/iIx8VZM2c=; b=KSMIGcVQgHN7brzGQaCY2uR7qFk3Zh1pfSRDxiL1KhddXmlm9ojnMM/hePinqo6lFI KNtkMUFsXNO0gDXQcKvKH90YxioOoGEMaALY9SBMvQGTJa4C87cv4n4wcAZse5g5Y+0O vkDAf2zYGjAajGrxc4GhBT9nNp83bvScSxhNA= 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=5KwqJJQz+RqPo1AdQAAwWW+39onvGph3i/iIx8VZM2c=; b=Jdp6irz0Rxf7rbS8oJ7vvoeX2MjFKpHdYmS60P6vnMPxaHyrBmjt1475xtGAe/ahE8 Sv5WFsOor0X3BvQXQSc732+lDAcZvJqnErUSsvLGVzwnenQ493fzg5OiQy6FqSBcRMnQ 9zmlBLtrobJthOzLOH1k3JuOHqQz6ilWKlUNWtlvcSZ/LDWLyQj4KHEYH/qL2f8Ns1sr Hio+UxK1txPAradZOo7oGeZUl/Q/52NmA60xqdu5GHP4P5svtSccW+fdPwRNSAUzWjYp 6X6hXFYZG6GKWBiN19yMaAQ5t5dsaYqBMCJJ04XJOihwCKFShQa/ydAqeAOSpuGF+pqW qw0g== X-Gm-Message-State: AOAM530A13Kzd84KVFrsz8+gJmErpMMrk44HTQJnRrG2meSHQVDOamvi Zn/LfrFKQGXXZLkEPMLJibICn7iILMgi0My4dpslKodY8llNLQ== X-Google-Smtp-Source: ABdhPJwDBJuQFG0NO/eS2KpgzxpN08ceN6PB/nd/WhvU5/wvQLE5te9PTmJPqjNwJkWosK/rL81c+Rx562vRmC5V9y8= X-Received: by 2002:a05:6602:314b:: with SMTP id m11mr11263619ioy.158.1614184044533; Wed, 24 Feb 2021 08:27:24 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Wed, 24 Feb 2021 09:27:13 -0700 Message-ID: To: internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Proposal: namespace the SPL From: internals@lists.php.net ("Levi Morrison via internals") On Thu, Feb 18, 2021 at 7:48 AM Levi Morrison wrote: > > On Thu, Feb 11, 2021 at 9:39 AM Levi Morrison wrote: > > > > Hello, everyone, > > > > There has been a lot of disagreement about namespacing, and people > > seem to have different viewpoints. I am not sure how to reconcile this > > broader discussion. > > > > However, there are certain names in the global namespace which I am > > hopeful we can revolve. For instance, `SplObserver`, `SplQueue`, > > `SplFixedArray`, etc all follow the `Spl` prefix. There is already an > > established "namespace" for these names. > > > > So here is my limited proposal: > > 1. We create names in the `Spl` namespace that are aliases to their > > equivalent types with the `Spl` prefix: > > `Spl\FixedArray` -> SplFixedArray > > `Spl\Queue` -> SplQueue > > a. The new names are the aliases so any code which uses > > `get_class($obj)` will not have the name change on them in a minor > > release (8.1). > > b. We may switch the direction of this alias in 9.0. > > 2. Any new types going into `ext/spl` use the `Spl` namespace. New > > types added to `ext/spl` should be either related to data structures > > or iterators, which is the bulk of what the SPL is. > > a. This rule is to help prevent the SPL from becoming the dumping > > grounds for new types. > > 3. We leave functions alone for now. > > > > Let me know what you think. I am hopeful this approach will work because: > > 1. It is focused on a specific area which already has an established > > "namespace", but in name-only (not technically). > > 2. It does not try to solve the larger problem, which has a lot of > > disagreement. > > 3. I will be proposing new types for ext/spl soon (`ReverseIterator` > > and an array iterator that is more efficient than `\ArrayIterator`), > > and Tyson Andre has already proposed `CachedIterable` and company > > which is in `ext/spl`, so this space has active development. > > > > Thank you for your time. > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: https://www.php.net/unsub.php > > > > There's been a lull in feedback, so let me steer it towards a specific > point that was brought up: how do you feel about adding aliases from > \Spl\Thing to \SplThing? > > https://strawpoll.com/22pcxh69p It's been about a week. Current standings out of 33 total votes: "I think they are important to the proposal." => 16 votes (~48%) "I prefer them to not be aliased." => 11 votes (~33%) "I don't care about them." => 6 votes (~18%) I'll think more about the discussion so far and these results and then either adjust or drop the proposal.