php.net |  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:
MUST BE VALID
Solve the problem:
41 - 28 = ?
Subscribe to this entry?

 
 [2011-01-21 06:20 UTC] trevor at blubolt dot com
Description:
------------
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 
cached.

I have also reproduced with 3.1.7.

Please see the gist below for a simple example.

Reproduce code:
---------------
https://gist.github.com/789541

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

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-18 21:48 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-11-18 21:48 UTC] kalle@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC