Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36162 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41344 invoked from network); 17 Mar 2008 07:50:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2008 07:50:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:12899] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/3D-00283-FC22ED74 for ; Mon, 17 Mar 2008 02:50:41 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 17 Mar 2008 09:50:58 +0200 Message-ID: <06B0D32C7A96544490D18AF653D6BDE5027598F7@il-ex1.zend.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Patch for opcode caches Thread-Index: AciGdZLbSu5+pX08TzSwmpYBtrg7UABjYN3A To: "Xuefer" , "Rasmus Lerdorf" Cc: "Marcus Boerger" , "Stas Malyshev" , "Andi Gutmans" , Subject: RE: [PHP-DEV] Patch for opcode caches From: dmitry@zend.com ("Dmitry Stogov") > -----Original Message----- > From: Xuefer [mailto:xuefer@gmail.com]=20 > Sent: Saturday, March 15, 2008 11:21 AM > To: Rasmus Lerdorf > Cc: Marcus Boerger; Stas Malyshev; Dmitry Stogov; Andi=20 > Gutmans; internals@lists.php.net > Subject: Re: [PHP-DEV] Patch for opcode caches >=20 >=20 > > I don't actually see early binding as being much of a problem, the=20 > > real problem is when the same class is both early and late=20 > bound. If=20 > > you consistently always bind early or always bind late,=20 > opcode caches=20 > > should be quite happy to let you do that. But if you mix the two,=20 > > things get chaotic and the problem becomes intractable. We went=20 > > through all this in APC a couple of years ago. My=20 > initial, somewhat=20 > > naiive attempt at > i'm not sure why i can't reproduce it years ago with apc=20 > enabled and i reproduce it with a complex script later. >=20 > a1.php > class a { function aMethod() { echo __FILE__; } } > a2.php > class a { function aMethod() { echo __FILE__; } } > child.php > class child extends a { } >=20 > main1.php which is requested first > include "a1.php"; > include "child.php"; > $child =3D new child() > $child->aMethod(); // aMethod() from a1.php, but what if i=20 > update a1.php after child.php is cached? >=20 > main2.php which is requested later > include "a2.php"; > include "child.php"; > $child =3D new child(); > $child->aMethod(); // aMethod() from a1.php because of early=20 > binding is done before cache? or from a2.php? >=20 > with and without opcode cacher, what is echo'ed if you=20 > requests main1 first and main2 later? >=20 > with the delayed early binding, php behavior exactly the same=20 > with opcode cachers enabled or disabled imho, with delayed=20 > early binding, every class is binded once when there is no=20 > opcode cacher, and opcode cacher can even decide to call bind=20 > api before cache. looks like we can always the delay the=20 > binding unless we want binary back compatbility for 3rd party=20 > modules? correct me if i'm wrong >=20 Compatibility is not an issue for php-5.3. We don't need to delay early-binding without opcode caches. It will do exactly the same as current early binding but slower. Thanks. Dmitry.