Re: Not autoloading functions

From: Date: Fri, 20 Jan 2017 18:55:51 +0000
Subject: Re: Not autoloading functions
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-97897@lists.php.net to get a copy of this message
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 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

« previous php.internals (#97897) next »