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.

If you are in a namespace and attempting to instantiate a class
named Directory you will either get the namespace version of the class,
or an Error as there is no fallback to the global namespace for classes.

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.

Finally, people may have typed properties, or parameters with the type
Directory, renaming this would break all that code.

Best regards,

Gina P. Banyard

Reply via email to