Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124581 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id C85B21A00B7 for ; Wed, 24 Jul 2024 20:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721851475; bh=Gl3OAlHD6RMMnDreYPPOzrj8buJ2kKQxciz8Cs/zIzQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=EXLl8d7i9Dl1tupJJS+5+Ce4XFCB2jpkzD1kNz/zb/a34bdHVjkmCr3wc4YnEHP3p 0k1vrEEOcCsT/zFCURpo8tquhptpOkvpe/qTJfgtiTciCddj53G7sL4xLQWnXffA/A x1wQ6T35/ZRyXhTYRSo1QAQKv63cxVgsDW1LPRboxHtSDUuQznAvstvlNn753SWMGg qI0oIEBA+5cEmxBXXUFvdeOM+taztskxdYK8RHt44veNCQeEi4rM2ZTcJiZyFVEhKw OYIqk0T9FC6A8KHUrMC3mFMMYZTUXM/SiFtKPYHGYRuFwgXPttR1z9Lbd/Pk3qAquv CWGSlmqQQBwNQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B6F018003A for ; Wed, 24 Jul 2024 20:04:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 24 Jul 2024 20:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1721851378; bh=J1gw5ybeAMVVSgphfGZlxTnYBv+I6cem6MsZ65dnzZA=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=Jw5gSY3oIkRERl4g25iO7WZ53tL3FPhHy+EL9XwBPH+uLrbNIPZ7cmjBjmFz+nPx6 y8t++fit+rIh6iHNg03Wvsgo0yxqybEbF2a/h2VkTFpHXSzhq5jT5AAtfV56LMDKEA yf2LxWQpKmcMfpZ1zrr/s92bqO6WiczyFpjZEARr7k67flqHb1DYcphajbgZWIm6vW pof+sS8cOH36VGBHX7TSwf93mh4hNqiwieW/Fs1rJ3hK8oToDyfGSON7GqZ8a964f4 rI/4wsz5Hk43n7onfB8jd1+BQKcQuayp9AIDBjXma4g4NKupjNeWhQvzjmA/8e39vz Lnz4fIxrCDKNg== Message-ID: <86b7e340-6ca9-4b3c-af0a-a5c2d1ee68c3@bastelstu.be> Date: Wed, 24 Jul 2024 22:02:57 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Should PHP reserve a namespace for built-in classes? To: Nick Lockheart , internals@lists.php.net References: <76559a9cd5eca4bc6799ed9612ce15c28cd7cb0a.camel@ageofdream.com> <95f6046a-4acf-4f8a-a850-a23650c0c6b3@bastelstu.be> <927705b0404e70b0f0ade4a3354b2598d7c112f9.camel@ageofdream.com> Content-Language: en-US In-Reply-To: <927705b0404e70b0f0ade4a3354b2598d7c112f9.camel@ageofdream.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 7/24/24 21:44, Nick Lockheart wrote: > Thank you. I've read through the RFC and see it was approved. Is it too > late to comment on this? My concern is that placing things into new and > arbitrary namespaces as per the RFC is just a different variation on > the global name problem. Commenting is of course possible, but any changes would require another RFC. In any case, the RFC's policy has already been used in the design of the new randomness API added in PHP 8.2. > I think a better solution would be to have one namespace for all > bundled classes, so that a specific namespace is reserved in advance. Needing to prefix everything by \PHP or something like this would provide for a terrible developer experience when using the standard library. > There was a vote on something similar four years ago, 13(no)/17(yes), > declined. It was four votes shy of passing: This is false. That RFC required a 2/3 majority to pass. > I think if we reserved `\php` and `\ext`, then there would be no need > to have multi-level namespaces, like the prior RFC proposed. I think > every standard class could just be `\spl\classname` without any naming > conflicts between core classes. And that would also avoid future > namespace collisions. Not using sub-namespaces would require making the classnames overly specific, because there's some names that make sense in different domains. An example would be a `Client` or `Connection`. Best regards Tim Düsterhus