Re: [PHP-DEV] Re: [VOTE] declare(function_and_const_lookup='global')

This is only part of a thread. view whole thread
  108308
January 29, 2020 04:48 larry@garfieldtech.com ("Larry Garfield")
On Tue, Jan 28, 2020, at 10:03 PM, Theodore Brown wrote:

> The RFC mentions two problems it hopes to solve: a minor performance > decrease, and developers having to deal with ambiguity. However, a > third problem that I think is just as important to fix is the lack of > function autoloading which makes extensive use of namespaced functions > unfeasible.
Without weighing in on the RFC itself, I really don't think this statement is true anymore. Back in the day, sure; autoloading for class-like-things only made functions second class citizens. However, Composer use is now near-universal for new code. Composer can load specific files full of functions during autoload just fine, and then the functions are universally available. That would have been a performance hit, but with opcode caching the hit is minimal. With preloading in 7.4, even that is reduced to almost zero. Between those two, having a library that is mostly a pile of namespaced functions that are just always-available is quite reasonable and feasible these days. Whether it's architecturally good or bad is another question, but I don't think the lack of autoloading is a good excuse anymore. --Larry Garfield