niihon Posted May 29, 2006 Share Posted May 29, 2006 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 8Line 8 is the declaration of class A in A.class.phpI 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 More sharing options...
trq Posted May 29, 2006 Share Posted May 29, 2006 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. Link to comment https://forums.phpfreaks.com/topic/10718-oop-scope-issues-i-think/#findComment-40022 Share on other sites More sharing options...
niihon Posted May 29, 2006 Author Share Posted May 29, 2006 include_once() worked - thanks i really appreciate it. Link to comment https://forums.phpfreaks.com/topic/10718-oop-scope-issues-i-think/#findComment-40029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.