Re: [RFC] Importing namespaced functions

From: Date: Thu, 15 Aug 2013 13:24:13 +0000
Subject: Re: [RFC] Importing namespaced functions
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-68528@lists.php.net to get a copy of this message
On Thu, 2013-08-15 at 14:11 +0100, Marcello Duarte wrote: > Hi, > > Are there any thoughts regarding importing multiple functions of a > namespace with a wildcard? > > A use case being, for example, assertions from a testing framework. > > use (or use function) TestingFramework\Assertions\<chosen wildcard > here>; // in java * is used for wildcard Unlike Java and others we can't easily know all available choices. Consider use (or use function) Foo\*; use (or use function) Bar\*; foo(); Will this be a global foo, Foo\foo or Bar\bar? This becomes more funny with the fact that PHP allows includes at runtime use (or use function) Foo\*; use (or use function) Bar\*; foo(); // only \foo() exists include 'Foo\foo.php'; foo(); // Foo\foo() now exists, too johannes

« previous php.internals (#68528) next »