> Compiler shouldn't generate different code. Unqualified name is resolved > at runtime, but code should be the same whatever resolution was made. > Did you check that different code is indeed generated? zend_compile.c =============== if (zend_hash_find(CG(class_table), lcname, Z_STRLEN(class_name->u.constant)+1, (void**)&pce) == SUCCESS && (*pce)->type == ZEND_INTERNAL_CLASS) { /* There is an internal class with the same name exists. PHP will need to perform additional cheks at run-time to determine if we assume class in current namespace or internal one. */ *fetch_type |= ZEND_FETCH_CLASS_RT_NS_CHECK; }
it's an optimization and assume that internal class never change let me guess, if you have php_abc.so which have "internal" (well, 3rd party) "class abc" not loaded when you encode php files with ZendEncoder namespace mynamespace; var_dump(new abc()); but you do load file for production server, you still get "undefined class mynamespace::abc" at runtime, internal class abc is never checked. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php