Jump to content

Recommended Posts

First off- I want to thank everyone for thier help - I really appreciate it.

I have three class A B C- B extends A - C extends B-

I am able to call functions from A from B, when i call functions from A from C i get this error:

Fatal error: Cannot redeclare class A in /home/techdoco/public_html/A.class.php on line 8

Line 8 is the declaration of class A in A.class.php

I went through all my code and removed the $this and replaced with :: (ie. A::function). Still getting this error.

Any ideas?


Thanks again

Link to comment
https://forums.phpfreaks.com/topic/10718-oop-scope-issues-i-think/
Share on other sites

Sounds as though you are redeclaring class A which has already been declaired. Really hard to see without code, and I imagine the code is to big to paste.

How are you including these classes together? Make sure your using include_once(), this prevents a class from being included twice.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.