Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113207 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 12253 invoked from network); 18 Feb 2021 15:01:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Feb 2021 15:01:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 641221804E2 for ; Thu, 18 Feb 2021 06:49:00 -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.7 required=5.0 tests=BAYES_05,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-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 ; Thu, 18 Feb 2021 06:48:59 -0800 (PST) Received: by mail-il1-f182.google.com with SMTP id g9so1681985ilc.3 for ; Thu, 18 Feb 2021 06:48:59 -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=ZWX0bQ1e8DKDpV7X4VAqSgi1g/qxha7SxfiKoW34Kak=; b=RbukGk163zz5jNj/hjeC0guhWnFeFcNdRG3oQtaZEloSnSDZgXju2JOm3BuaeMmQ2V CapbmD6rsUqhgB1FyzYfpNPpxeJKyj5S54l9Xfkz5vjqlMvVwy4R65CfbgyTZXUtNmDJ 0biHNRMOykgU28a5ByfzQpWrnNQCq4Tdxew2I= 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=ZWX0bQ1e8DKDpV7X4VAqSgi1g/qxha7SxfiKoW34Kak=; b=alqXK/oEcIocVeOPk+aCUNKVVEK23TrwhM9fFllNgM8D9rjY0xAJUjyZ04Smr/50xc +rTqtccc06IhXFxTk3uUzCQ2IS5g8bRyxxmlXiBJ5f5xeEXe5KrFNVHgwOI/q9zEUX3p PMMfOrrZL+Le7Nbvw9Op2hLzPm/av2ny3ONbUllgVQTD5FaPufGdOqEYfSfXQnruhne9 JDLfj9Dum6mez9eeAwNlbVZ+nH92VA3nfa8z6H+MCIgEx3zIAO96nQhJp2ipgmYBPSvZ IumgYJxrmL14llGemXeWPZJaV6vwfC8xU/8XhAqiDbo9zz7dTGVpsdnSvczJBdqPl7Hu yGTg== X-Gm-Message-State: AOAM532tba2OV27+NiDS7EGcYYrL5nN5pNqaVzBvi7SUJd2hXeFLhGdw VRfTogA13Q3RKgkVUj8/hkPpD/0fJs9u90yO480dDYEClTTyeg== X-Google-Smtp-Source: ABdhPJzqg3AxFYMcVl18oeyegI5aICEhiGXct4XzrrEiwdjZSY37E2vhkJwa4HSeYh5u0KBugubxTGkuVC9CZXxB9Qs= X-Received: by 2002:a92:c26a:: with SMTP id h10mr4135765ild.234.1613659737892; Thu, 18 Feb 2021 06:48:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Thu, 18 Feb 2021 07:48:47 -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 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