php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24470 Crash with message 'Cannot redeclare class' in 4.3.0.RC4
Submitted: 2003-07-02 20:41 UTC Modified: 2003-07-02 21:46 UTC
From: lucian at moongate dot ro Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.0RC4 OS: Windows 2000 PRO SP3
Private report: No CVE-ID: None
 [2003-07-02 20:41 UTC] lucian at moongate dot ro
Description:
------------
I'm using the ISAPI module.
My class (and other includes) names are stored in an array like:
'Class_name'=>'Class_file.php'
each time I need to include a file I do this:
$_incReq=array('Include_1','Include_2');
include($_incMgr); 
where $_incMgr is a script that checks whether that file has already been included and also includes files required by my include.

When the include manager first runs it includes the class file and doesn't get to the class definition but receives and array of required includes. After it resolves those it includes the file again and this time, when it gets to the class definition, I get the error: Cannot redeclare class ...

I would like to point out that an identical class (with just some names changed works fine in another project). Also, I encounter this problem with just one class.

And I'm sure that the class hasn't been included before because:
1. the Include Manager would not include it twice.
2. I've checked exaclty how many times it gets to the class declaration part and it's 1.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-02 21:46 UTC] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Exactly WHAT version? It's definately NOT irrelevant!
And give a complete, standalone, self-contained, etc.
example script which can be used to reproduce this problem.

(and PHP 4.3.2 was released long time ago..)

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 22 21:00:03 2025 UTC