Anti-Moronic Posted May 21, 2009 Share Posted May 21, 2009 I have 3 files, index, funcs, and test. In index I have: <?php include("funcs.php"); include("test.php"); ?> in funcs: <?php class simple{ function speak(){ echo "it works"; } } $simple = new simple; ?> ..and in test, I have: <?php $simple->speak(); ?> The problem is that it is not finding the class. Can anyone explain why? Any help is greatly appreciated. Thanks. EDIT: ERROR: Call to undefined method simple::speak() Link to comment https://forums.phpfreaks.com/topic/159037-solved-little-problem-with-class-scope/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.