|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56189 Internal class extension still throws redeclaration error
Submitted: 2004-09-08 09:46 UTC Modified: 2014-02-28 12:34 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: pecl at todgillespie dot com Assigned: krakjoe (profile)
Status: Closed Package: APC (PECL)
PHP Version: 4.3.3 OS: FreeBSD 4.10 RELEASE
Private report: No CVE-ID: None
 [2004-09-08 09:46 UTC] pecl at todgillespie dot com
I'm getting a 'cannot redeclare class' error on an otherwise working class extension in APC 2.0.4.  It seems this is an issue that should have been resolved with the current release, but I'm certain I'm running the current version. 

I recently installed the APC 2.0.4 FreeBSD port from the current 4.10 RELEASE.  When I do

#pear list

I see that I'm really running APC version 2.0.4.

I'm using Smarty, and extending the class to add some of my own functionality.  When I turn on APC in php.ini, I get the following error:

Fatal error: Cannot redeclare class smarty:smarty_tod in /usr/local/share/tod/smarty/Tod.Smarty.class.php on line 4

When I disable APC, I get normal behavior.

It may or may not be important that the extended class is in a separate directory in the include_path.

My humble apologies if this is not really a bug.  I checked the pecl-dev and pecl-cvs lists extensively, as well as all the other resources I could come up with.

Thanks for your time.

Reproduce code:

class Smarty_tod extends Smarty {
	function Smarty_tod() {
		global $lan_common;
		$this->assign_by_ref('lan_common', $lan_common);

Expected result:
APC should make my application run much faster.

Actual result:
Fatal error: Cannot redeclare class smarty:smarty_tod in /usr/local/share/tod/smarty/Tod.Smarty.class.php on line 4


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-28 12:34 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-02-28 12:34 UTC]
Closing, for a number of reasons:

 The bug is ~10 years old.
 The original behaviour cannot be present any more.
 APC is no longer the primary, supported means by which we advise caching opcodes.

Thanks for helping to make PHP better :)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 03:01:28 2024 UTC