Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125716 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 64A7B1A00BD for ; Tue, 1 Oct 2024 20:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1727814207; bh=f6cxpwbt6ULXNNalrMoFMDPG54koI3KZDgxPGN6JOYM=; h=Subject:From:To:Date:In-Reply-To:References:From; b=DifkFIsh9UnBZ465v2hemvOrbg+qc2jwbIW3Xlh0VGbwdaJmfQ3q/6YTT8XZbOa6d +hm6F6bF9DnkKgyhYXwrb+Xc5tvfRoe6Oeq8qhaig+0szOl23yxUGRockszvNRaQiJ 1t6NQiupj5iekQ3zG/Wi4igfiuqu2pPE21TZcfVcteTijSKTSjiuh/njh9B6XHE0Cw Vtm1RQb85tvWrgkHIX8CT2UEOo6GNKJGkSvvR8/vNl0eEvpSHF9PGjSSX2OI23JiWJ aZBot7HvLrQeGg2GybGqTaMQITyW5S6wYiIAOzpeOf8pUbaYuYWtdWha8lO/99nZJ/ p6oGZ0t5QH2og== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9069318004F for ; Tue, 1 Oct 2024 20:23:26 +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_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from ageofdream.com (ageofdream.com [45.33.21.21]) (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 ; Tue, 1 Oct 2024 20:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ageofdream.com; s=ageofdream; t=1727814072; bh=f6cxpwbt6ULXNNalrMoFMDPG54koI3KZDgxPGN6JOYM=; h=Subject:From:To:Date:In-Reply-To:References:From; b=O24xP012xaknGqtSW1jJFOABZUxsMZs8yZFdw+NqKTToD/vUXHRemn76ewHczT+A7 3b79FyL4+g7kuPqPFIbKmHeOrh/Wa6XJNkQYaRGM4/6KGv57KRk7vDJHmfi45u2s2C R3XexU+NlLb/6AZABUyyQROlLDGNo4acvy6nLatnMbKVB0y0S57o/iZ5mi7kQqSRTE bVPdafMlvs6K8PSEQE+q6vsBqcNpb0kx/8fUJyXKvSeIpQIpmSLg4EW7GrKZS+6M6Q +t+O5H0QJsmo6Y+8WHHISOv1yd+pFLwW+2+ADa2kN0x88cFPHr4kzAbOeBw+OXSyCk t+NQTf4b72l9g== Received: from [192.168.1.7] (unknown [72.255.194.227]) by ageofdream.com (Postfix) with ESMTPSA id 0206D278D7 for ; Tue, 1 Oct 2024 16:21:11 -0400 (EDT) Message-ID: <680c10a5523288e4b1df2760e6e03da61a1ac6c5.camel@ageofdream.com> Subject: Re: [PHP-DEV] [RFC] Change Directory class to behave like an opaque object To: internals@lists.php.net Date: Tue, 01 Oct 2024 16:21:11 -0400 In-Reply-To: References: <2VnM6xycBpzqzDnAZKWS4zxCSUjvoKywJRiBzTcGhS8axaFS7QwbGNQtjkovo1jQi1XLiEGGTi3KfQfWoxUT527U_-6IGO3092BZdW436q0=@gpb.moe> <3ab9db77462c5f49c7c4a977098ba4677deb363f.camel@ageofdream.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 From: lists@ageofdream.com (Nick Lockheart) On Tue, 2024-10-01 at 16:36 +0000, Gina P. Banyard wrote: > On Wednesday, 25 September 2024 at 10:12, Nick Lockheart > wrote: >=20 > > On Sat, 2024-09-14 at 15:33 +0000, Gina P. Banyard wrote: > > I don't suppose we could call the Directory class something else, > > like > > "SPLDirectory"? > >=20 > > You can't make a Directory with `new` (or at least you aren't > > supposed > > to be able to), so any existing code would already get a Directory > > object with `dir()` not `new Directory()`. There would be no BC > > break > > with a rename. >=20 > This is factually incorrect. > This would be a large BC break, moreover PHP "owns" the global > namespace. >=20 Is every single word really a reserved word in the global namespace? > Otherwise, if you are in the global namespace and try to create a > class which is called Directory this would result in an Error being > thrown. >=20 Actually, it will not throw an error because classes are auto loaded. The auto loader will not run because Directory is already registered. It will instantiate a built-in Directory object.=20 An error would only be thrown if the file with the other Directory class is manually included, which most people do not do anymore for class definitions.