php.net |  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
Votes:1
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
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: pecl at todgillespie dot com
New email:
PHP Version: OS:

 

 [2004-09-08 09:46 UTC] pecl at todgillespie dot com
Description:
------------
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:
---------------
<?
require('Smarty.class.php');

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-28 12:34 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-02-28 12:34 UTC] krakjoe@php.net
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: Sat Apr 27 19:01:29 2024 UTC