Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43897 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41246 invoked from network); 12 May 2009 10:54:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2009 10:54:01 -0000 Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.46.28 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 74.125.46.28 yw-out-2324.google.com Received: from [74.125.46.28] ([74.125.46.28:9549] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/E4-05302-845590A4 for ; Tue, 12 May 2009 06:54:01 -0400 Received: by yw-out-2324.google.com with SMTP id 3so1963632ywj.83 for ; Tue, 12 May 2009 03:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=FQ8sI5XEf0br7VW1KCGIQ/3I55Wew/c1MpXTVbMab2s=; b=Xpw01Jhl++N+A7Bw2osOK8eO6CNEx8pZzg63NvMpmFekwHaLvNdOcfrlcFkco74TWX KcFqBbUK7KEDiDDbavCc7zp1dxX7FIJyGhhteDNQRBdStgd6wNUqSxdtVbo9ZY1kxSuf mwCVtcvON6vPJu3QmXa/QskZ6oPo2Xb2g5CG0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=idACnG07scaNeU571OGcNVf9ETG4BvltlUzPOXZ95D44y04aRDQ5vBXBQ5cx0qdEel dLTrbjvJ4KefATC4gnBSV6nTvntURldbt74sbErHk+wJhFIcDTicYzOq15QWtKh3Sw8M V1g4iQMtTv0uge2PpfMVTavE9UmQYGhWbBjhQ= MIME-Version: 1.0 Received: by 10.231.14.74 with SMTP id f10mr1541955iba.20.1242125638072; Tue, 12 May 2009 03:53:58 -0700 (PDT) In-Reply-To: <4A0936B0.8000802@zend.com> References: <155749706.20090117211737@marcus-boerger.de> <497872B8.60807@zend.com> <4A08CA5F.7010200@zend.com> <4A0936B0.8000802@zend.com> Date: Tue, 12 May 2009 11:53:38 +0100 Message-ID: To: Dmitry Stogov Cc: Stanislav Malyshev , Guilherme Blanco , Marcus Boerger , Timm Friebe , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Method call improvements From: paul.biggar@gmail.com (Paul Biggar) On Tue, May 12, 2009 at 9:43 AM, Dmitry Stogov wrote: >> Apologies, I'm not familiar with run-time inheritence in PHP. My >> understanding was that when a classes source code is compiled, its >> parent classes must be known. When is this not the case? > > The parent class may be defined in other file that is loaded at runtime > using include() statement. It's very usual case. So the PHP first loads the > include file and then declares child class at runtime. >> Must it be known for the class' first instantiation? > > Of course. :) On Tue, May 12, 2009 at 7:25 AM, Dmitry Stogov wrote: > The real things is even worse as during compilation of a class it's parent > class doesn't have to be known. So construction of VMTs becomes a bit > problematic. BTW we could think in this way... OK, so I dont understand this exactly. Is it correct to say that if a class uses inheritance its compilation will be deferred until its first instantiation? Or is it compiled when it is seen, and its parent backpatched in later. When is later? But I think its fair to say that it has static inheritance - that is, its full inheritance chain is known before it can be instantiated, and it can never be changed after that. >> In the worst case, it _might_ be cheaper to build it at instantiation >> time, but I would have to look up how expensive that is in a more >> static language to be sure. Certainly, it is currently so expensive >> that almost anything else would be better (including the OP's patch). > > I don't see how run-time VMT contraction may help, because calls to virtual > method must know VMT offset at compile-time. Right. Construction is fine. Their use is not. I don't know what I was thinking. So it looks like the best way forwards is still the OP's patch? Thanks, Paul -- Paul Biggar paul.biggar@gmail.com