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.