Re: Should PHP reserve a namespace for built-in classes?

From: Date: Sat, 27 Jul 2024 23:11:01 +0000
Subject: Re: Should PHP reserve a namespace for built-in classes?
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-124659@lists.php.net to get a copy of this message
On Sun, 2024-07-28 at 00:48 +0200, Claude Pache wrote: > > For the case of functions (and constants) in the global namespace, > there was an RFC on the subject about 4 years ago, which has been > declined; > see: https://wiki.php.net/rfc/use_global_elements and the > discussion threads referenced at the bottom of that page. The top of the RFC correctly outlines the problem; a problem that still exists. Maybe the proposed solution wasn't the best approach, but it still remains an issue: Classes that are built-in to PHP are and will cause naming collisions with developer code. I think the C++ approach is simple and elegant: using std::string; The C++ standard library will never collide with user code as you ask for it when you want it.

« previous php.internals (#124659) next »