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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: trevor at blubolt dot com
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 22:01:23 2020 UTC