> De : sebastian.krebs.ber...@gmail.com
> > I hope you find more support on this than I had. Technically
> speaking,
> > it would be easy to extend autoloading to functions and constants. It
> > can even be done without BC breaks, combining 'old-style' and 'new-
> style'
> > autoloaders without ambiguity (adding a second argument to the
> > autoload hook, and checking the number of args declared by the
> function).
> >
> 
> Thats not even required, if you fixate (--> default value) the second
> parameter to "class" all existing loaders will behave, like they did
> before.

Correct, but that's not enough to preserve BC.

OK, giving a default value of 'class' to the second arg allows using a 
'new-style' autoloader with an 'old-style' PHP engine.

But, now consider the opposite, using a 'new-style' PHP engine, with 
autoloading extended to functions and constants, with one or more 'old-style' 
autoloaders: when the engine needs to autoload a function or a constant, we 
must not call any 'old-style' autoloader, as it would take the symbol and 
attempt to load a class by that name. And the easiest way to decide if an 
autoloader is a new or old-style one is to check if the autoload handler func 
is declared with one or two args.

François


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to