There is lazy loading for functions via apc.lazy_functions (although I've not properly tested this yet). That doesn't require any userspace code changes.
For define() I'm not aware of anything allowing for lazy loading constants (define() is just a function call). However there are a few approaches for avoiding define(), you could look at apc_define_constants(), http://pecl.php.net/package/hidef and http://pecl.php.net/package/chdb, you could also switch to class constants and lazy load your classes. I haven't On Tue, Jul 26, 2011 at 5:18 PM, Sebastian Krebs < sebastian.krebs.ber...@googlemail.com> wrote: > Hi, > > Maybe this topic occured already, then sorry when I'm wasting your time, > but I'm wondering, why there is no autoloading for functions and > (namespace)constants. > > When a class is not found, then an userland function is called. Thus I > don't see a reason, why something like this doesn't exists for functions and > (namespace)constants too, because using them is quite uncomfortable right > now compared to classes and the decision _how_ to load them would be on the > developers-side anyway. > > Sebastian Krebs > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >