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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Fri Dec 27 07:01:28 2024 UTC