Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34280 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46436 invoked by uid 1010); 30 Dec 2007 12:16:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46421 invoked from network); 30 Dec 2007 12:16:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2007 12:16:11 -0000 Authentication-Results: pb1.pair.com header.from=xuefer@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=xuefer@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.179 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: xuefer@gmail.com X-Host-Fingerprint: 209.85.146.179 wa-out-1112.google.com Received: from [209.85.146.179] ([209.85.146.179:13015] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/C7-01652-A0C87774 for ; Sun, 30 Dec 2007 07:16:11 -0500 Received: by wa-out-1112.google.com with SMTP id l24so7559208waf.17 for ; Sun, 30 Dec 2007 04:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=1WUB8U5JpxudN8GeupKdid+H/97dpqiQr9a+w8chNVc=; b=icbiiw147hST9U74NpMYfaGjxPSHBnKs2R686CP7N7WawAd1ANmrynk7TqJsN5by/m9tJhBGe681lkG2hYccftulbsWQjdMFFgFj5LGn46+DDsVJJdzFbtPffoekX/9OemJR7ODZ1N6LU9JeqHOPZfbZGoIVj0vLy4L2RyraSv4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=jdl9jj971wwazYMVJJHj+phaY+rRne3kE3fj6/i8Uhg/6Mfor0Ovs3cFrbnDIy7qjm1OQnvYvzRtVORVYyYbIpdTaLG1pKGBXP9qVzELTayLh5mEjxYceTcrLs7txexuYbTP83Ytt/aPnj/Ezk1GU6Aw8mOQeLJ5u7pZiSy3XTc= Received: by 10.114.92.2 with SMTP id p2mr10652686wab.90.1199016967168; Sun, 30 Dec 2007 04:16:07 -0800 (PST) Received: by 10.114.36.15 with HTTP; Sun, 30 Dec 2007 04:16:07 -0800 (PST) Message-ID: <28139bc0712300416y6773ac32v8a39d9359bee9d1c@mail.gmail.com> Date: Sun, 30 Dec 2007 20:16:07 +0800 Sender: xuefer@gmail.com To: "Stanislav Malyshev" Cc: "php-dev List" In-Reply-To: <47776A7E.3030304@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <28139bc0712300135s399eb826k87a061a52eac5066@mail.gmail.com> <47776A7E.3030304@zend.com> X-Google-Sender-Auth: eab72b5ff0c59342 Subject: Re: [PHP-DEV] early class binding revisited From: phpxcache@gmail.com (phpxcache) > 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.