Re: [RFC lite] implement import of functions in namespace

From: Date: Thu, 22 Jan 2009 06:03:26 +0000
Subject: Re: [RFC lite] implement import of functions in namespace
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-42764@lists.php.net to get a copy of this message
On Wednesday 21 January 2009 2:19:53 pm Greg Beaver wrote: > [Drawbacks] > 1) requires changing the engine near beta Legitimate concern, but I happily defer t the maintainers here. > 2) adds new syntax to namespaces If I'm reading the RFC properly, it extends the existing syntax in a logical way without introducing any new reserved words. My only question then would be should we change the way classes are imported to use the keyword "class", to parallel this syntax? Eg: use class Foo\Bar; use function Foo\fanciness; If we're concerned about breaking code written for the existing alphas, perhaps "class" could be implied if not specified, so that we can recommend using it but not break existing code? I'm not sure if there's a performance concern there. > [Non-issues/Slight issues] > 1) would introduce one hash lookup on unqualified function calls at > compile-time if any "use" statement exists in the script, which is > unlikely to be detectable as a performance difference for even the > largest scripts. > > Thanks, > Greg +1 from me. -- Larry Garfield larry@garfieldtech.com

« previous php.internals (#42764) next »