Re: Importing namespaced functions

From: Date: Sun, 21 Apr 2013 03:00:03 +0000
Subject: Re: Importing namespaced functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-67102@lists.php.net to get a copy of this message
> What's wrong with referencing one part of it? It can be as short as two > characters, and an an added bonus you won't suddenly have your strlen > overridden by somebody without you knowing it. Functions live in global > space, and there's a real lot of them, that's why importing them wasn't > considered a good idea - it's going back to the same problem we were > escaping with namespaces. > > Saving two keystrokes while sacrificing clarity is usually not the best > idea. The same argument could be made for classes. Why import them if you can just import the namespace? I think it reduces noise and allows imported functions to be treated as an extension of the language. Without polluting the global namespace. As it stands, functions are a second class citizen in PHP. It is harder to use them due to arbitrary restrictions that don't apply to classes.

« previous php.internals (#67102) next »