|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59586 Class inheritance incorrect when base class is a variable alias
Submitted: 2011-01-21 06:20 UTC Modified: 2016-11-18 21:48 UTC
From: trevor at blubolt dot com Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
44 - 42 = ?
Subscribe to this entry?

 [2011-01-21 06:20 UTC] trevor at blubolt dot com
We have a setup where we have multiple client base model 
classes which are aliased to a common name with class_alias 
depending on which client the current request pertains to.  
These "virtual" classes are then extended by the core 
application model classes.

When APC is enabled the application classes always extend the 
client model which was aliased at the time that include was 

I have also reproduced with 3.1.7.

Please see the gist below for a simple example.

Reproduce code:

Expected result:
Repeated runs should expect and get a model for the same 

Expecting model for client a
Got model for client a

Expecting model for client b
Got model for client b

Actual result:
Repeated runs always get a model for the client chosen in the 
first run:

Expecting model for client a
Got model for client a

Expecting model for client b
Got model for client a


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-18 21:48 UTC]
-Status: Open +Status: Wont fix
 [2016-11-18 21:48 UTC]
APC is no longer supported in favor of opcache that comes bundled with PHP, if you wish to use the user cache, then look at PECL/APCu.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 24 23:01:23 2021 UTC