PHP Cannot redeclare class


Posted on 16th Feb 2014 07:03 pm by admin

I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot redeclare class" error.

** edit **
I know its these 2 files, because when i comment out the include for login.php, the error goes away.
**end edit**

The full error:
Fatal error: Cannot redeclare class Base in coreBase.php on line 7

Base.php
Code: <?php
/**
* Base.php is the base class for all functions.
*
*/

class Base {

function __construct() {

include("Admin.php");
include("Feed.php");
include("Login.php");
include("Session.php");
include("SQLManager.php");
include("Twitter.php");

}

function __destruct() {
}

}
?>
Login.php
Code: <?php
/**
* Login.php is the class for all Application login functions.
*
*/

class Login extends Base {

function __construct() {
}

function Login() {
}

function Logout() {
}

function __destruct() {
}

}
?>
All of the files that are included in the Base __construct, extend Base.

Anyone have any ideas?

No comments posted yet

Your Answer:

Login to answer
302 Like 14 Dislike
Previous forums Next forums
Other forums

Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to ret

Comparing MySql data and arrays.
I have a mysql table set up like this:
idsubjectbodyuseriddatetimetags1blog subjectblog body111|2

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

cURL Upload Help
OK, I am creating a bridge from a local program to my website and I am trying to find the best way t

Error with Font and imagettfbbox
I keep getting an error that says "Warning: imagettfbbox() [function.imagettfbbox]: Could not f

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

Checking BOM Authorization Group
Hai Friends,

I have developed a mulitilevel BOM display report. End users have been assig

unexpected T_SL without a shift left token
Nothing too see here, I'm an idiot and resolved the problem.

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

get the country of visitor and display content based on that
Hello all,

I have seen that Google analytics can tell you where a visitor is coming from and

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash