# Issue with custom stream wrapper, include and APC

- Thread: https://externals.io/message/54730
- Original archive: https://news-web.php.net/php.internals/54730
- Started by Christian Kaps on 2011-08-19T12:54:29+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #54730 — Christian Kaps — 2011-08-19T12:54:29+00:00

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

Hi!

I have a problem with APC and a custom stream wrapper implementation.
The wrapper is used to include generated PHP classes. If APC is enabled
it seems that the include statement(used with different URL's), loads
always the first included class from cache.

The following code illustrates the issue a bit more.

https://gist.github.com/1156717

If executing it with APC enabled, I get the following fatal error.

Fatal error: include(): Cannot redeclare class test1 in ... on line 78
PHP Fatal error:  include(): Cannot redeclare class test1 in ... on line 78

Is this a bug? Or do I miss something?

Christian

---

## #54732 — Pierre Joye — 2011-08-19T13:07:35+00:00

URL: https://externals.io/message/54730#54732 · In reply to: #54730

hi,

Have you tried using the latest version of APC or using svn's trunk?

If not please try it and report a bug at pecl.php.net/apc if it still occurs

Thanks for your feedback!

On Fri, Aug 19, 2011 at 2:54 PM, Christian Kaps
<christian.kaps@mohiva.com> wrote:
> Hi!
>
> I have a problem with APC and a custom stream wrapper implementation.
> The wrapper is used to include generated PHP classes. If APC is enabled
> it seems that the include statement(used with different URL's), loads
> always the first included class from cache.
>
> The following code illustrates the issue a bit more.
>
> https://gist.github.com/1156717
>
> If executing it with APC enabled, I get the following fatal error.
>
> Fatal error: include(): Cannot redeclare class test1 in ... on line 78
> PHP Fatal error:  include(): Cannot redeclare class test1 in ... on line 78
>
> Is this a bug? Or do I miss something?
>
> Christian
>
> --
> 
> 
>
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #54733 — Christian Kaps — 2011-08-19T13:27:44+00:00

URL: https://externals.io/message/54730#54733 · In reply to: #54732

Thanks for your fast feedback. I've tried it with the latest(3.1.9)
version. Can someone who has the actual trunk compiled, give feedback
for the snippet(https://gist.github.com/1156717)?

Christian


Am 19.08.2011 15:07, schrieb Pierre Joye:
> hi,
> 
> Have you tried using the latest version of APC or using svn's trunk?
> 
> If not please try it and report a bug at pecl.php.net/apc if it still occurs
> 
> Thanks for your feedback!
> 
> On Fri, Aug 19, 2011 at 2:54 PM, Christian Kaps
> <christian.kaps@mohiva.com> wrote:
> > […]
