Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6077495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:43:38+00:00 2026-05-23T10:43:38+00:00

I have had some really strange errors here with php today. I’ve written a

  • 0

I have had some really strange errors here with php today.

I’ve written a little class for A/B Testing and wanted to create a new instance in a php document of mine:

if(!class_exists('ab_tester')) include('../lib/php/ab_tester.php');
$ab = new ab_tester($user['id']);

One would think this should do the trick, but php says:

Fatal error: Cannot redeclare class ab_tester in [PATH_TO_PHP]ab_tester.php on line 10

Why does this happen?

Note: Line 10 of the ab_tester.php looks like this:

class ab_tester {

If I leave the include line out, creating a new instance of ab_tester, it spits out:

Fatal error: Class 'ab_tester' not found in [PATH_TO_PHP]returning.php on line 25

What do I do now? If I try to import it, it’s already there and if I don’t, its missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:43:38+00:00Added an answer on May 23, 2026 at 10:43 am

    And what do the first 9 lines of code in ab_tester.php contain?

    I bet that there is another class ab_tester there (or in an include, anyway)

    EDIT:

    Another possible explanation is that you are doing a second include of ab_tester.php later on the code of returning.php. So even if you use include_once in this particular line, the second call is still just an include…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a question that I have had for some time but never actually
I have a little problem. I had some JComboBox to a JDialog but they
I have seen a lot of upload forms hacked, and some had some really
In my limited experience, I've been on several projects that have had some sort
What are some strategies that people have had success with for maintaining a change
I have had a hard disk failure which resulted in some files of a
I have a live database that had some data deleted from it and I
I would love to get some tips from other people that have had this
I'm sure that all of us have had to deal with telecommuters at some
I have recently upgraded from websphere 5.1.2 to websphere 6.1 server. I had some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.