Re: Not autoloading functions

From: Date: Fri, 20 Jan 2017 18:58:26 +0000
Subject: Re: Not autoloading functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-97898@lists.php.net to get a copy of this message
On Fri, Jan 20, 2017 at 7:55 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote: > Hi! > > > Since the autoloading functions proposal is stalled, how about allowing > for > > import of static functions instead? > > > > use function Foo::bar; > > > > bar(); // calls Foo::bar() > > I'm not sure why it is good. This would certainly be confusing, if you > call strlen and turns out it's completely different function from what > you thought. One thing when it's the same namespace, at least you can be > aware what this package does, but if it's just an arbitrary function > from anywhere, it's really bad for understanding the code. > How is that different from the already existing "use function foo\bar\baz as strlen"? > How hard is it to write Foo::bar? You never have to go more > than one level. I don't see a point in mixing internal function > namespace with class methods for the sake of saving typing couple of > characters. > > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#97898) next »