# Patch for opcode caches

- Thread: https://externals.io/message/36162
- Original archive: https://news-web.php.net/php.internals/36162
- Started by Dmitry Stogov on 2008-03-17T07:50:58+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #36162 — Dmitry Stogov — 2008-03-17T07:50:58+00:00

URL: https://externals.io/message/36162#36162

> -----Original Message-----
> From: Xuefer [mailto:xuefer@gmail.com] 
> Sent: Saturday, March 15, 2008 11:21 AM
> To: Rasmus Lerdorf
> Cc: Marcus Boerger; Stas Malyshev; Dmitry Stogov; Andi 
> Gutmans; internals@lists.php.net
> Subject: Re: [PHP-DEV] Patch for opcode caches
> 
> 
> > […]
> bound.  If 
> > […]
> opcode caches 
> > […]
> initial, somewhat 
> > […]
> i'm not sure why i can't reproduce it years ago with apc 
> enabled and i reproduce it with a complex script later.
> 
> a1.php
> class a { function aMethod() { echo __FILE__; } }
> a2.php
> class a { function aMethod() { echo __FILE__; } }
> child.php
> class child extends a { }
> 
> main1.php which is requested first
> include "a1.php";
> include "child.php";
> $child = new child()
> $child->aMethod(); // aMethod() from a1.php, but what if i 
> update a1.php after child.php is cached?
> 
> main2.php which is requested later
> include "a2.php";
> include "child.php";
> $child = new child();
> $child->aMethod(); // aMethod() from a1.php because of early 
> binding is done before cache? or from a2.php?
> 
> with and without opcode cacher, what is echo'ed if you 
> requests main1 first and main2 later?
> 
> with the delayed early binding, php behavior exactly the same 
> with opcode cachers enabled or disabled imho, with delayed 
> early binding, every class is binded once when there is no 
> opcode cacher, and opcode cacher can even decide to call bind 
> api before cache. looks like we can always the delay the 
> binding unless we want binary back compatbility for 3rd party 
> modules? correct me if i'm wrong
> 

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.
