On 08/08/2016 17:00, Levi Morrison wrote:
I think saying "add a backslash in front of your function names to
avoid them being slow" will just lead to lots of "lol wtf php sux".
They'll say the same when function and class autoloading don't work the
same way anyway. I think unifying their behavior over time is the best
solution forward. Yes, I'm talking about a BC break eventually, but the
suggestion to autoload only fully qualified function names could buy us
the time to make that BC break less severe.
Do you mean eventually changing the name resolution rules for functions
to match those for classes? I wasn't around at the time it was
discussed, and if we were adding them now would be tempted to say the
leading \ should always be mandatory, just like it is for classes. But
since we have what we have, I don't see that big an advantage to
changing it.
If not, I don't see why we ever need to be able to autoload global
functions. "You want autoloading? Put it in a namespace." Like I say,
that leaves the very small edge case of a single namespace spanning
multiple files, and an autoloader implementation able to include one of
them when a function is called from another.
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php