On Tue, 2024-10-01 at 16:36 +0000, Gina P. Banyard wrote: > On Wednesday, 25 September 2024 at 10:12, Nick Lockheart > <li...@ageofdream.com> wrote: > > > 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"? > > > > 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. > > This is factually incorrect. > This would be a large BC break, moreover PHP "owns" the global > namespace. >
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. > 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. 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.