On 01/22/2013 07:20 PM, Dmitri Ravazin wrote:
> hey, here's an idea. Let's drop class autoloading 'magic' as well,
> because it has all the same 'problems' that you've just described.
> It loads things at 'completely arbitrary' times, it's complicated, and
> it surely makes reading code 'too hard'. And the gains are 'very
> little', anyway.
> You can always load your classes manually with a bunch of require
> statements, right?

It is trickier than autoloading because __init() tries to blur the lines
between the compile and execute stages if I read your original email
correctly. And we have some magic in the compiler that tries to optimize
things and resolve as much of the inheritance chain as possible at
compile-time to the point where ZEND_FETCH_CLASS opcodes are NOP'ed
away(*). I suppose this could still hang off of the the initial
ZEND_FETCH_CLASS for a class, but it would definitely get tricky to
determine when this would happen.

(*) http://lxr.php.net/xref/PHP_5_4/Zend/zend_compile.c#4444

-Rasmus

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

Reply via email to