unkwntech Posted November 30, 2008 Share Posted November 30, 2008 I have the following code: class myClass { public $myVar; public function __CONSTRUCT() { $self->myVar= $self->myFunc(); //Error Here } private function myFunc() { return 'Hello World'; } } $var = new myClass; echo $var->myVar; I am getting this error: <b>Fatal error</b>: Call to a member function myFunc() on a non-object Quote Link to comment https://forums.phpfreaks.com/topic/134893-solved-need-some-more-oop-help/ Share on other sites More sharing options...
DeanWhitehouse Posted November 30, 2008 Share Posted November 30, 2008 There is a OOP forum. Quote Link to comment https://forums.phpfreaks.com/topic/134893-solved-need-some-more-oop-help/#findComment-702436 Share on other sites More sharing options...
unkwntech Posted November 30, 2008 Author Share Posted November 30, 2008 @Blade... no theres not it was deleted, see this post for info: http://www.phpfreaks.com/forums/index.php/topic,227707.0.html Quote Link to comment https://forums.phpfreaks.com/topic/134893-solved-need-some-more-oop-help/#findComment-702441 Share on other sites More sharing options...
DeanWhitehouse Posted November 30, 2008 Share Posted November 30, 2008 o, my bad. Quote Link to comment https://forums.phpfreaks.com/topic/134893-solved-need-some-more-oop-help/#findComment-702443 Share on other sites More sharing options...
DarkWater Posted November 30, 2008 Share Posted November 30, 2008 $self should be $this. Quote Link to comment https://forums.phpfreaks.com/topic/134893-solved-need-some-more-oop-help/#findComment-702444 Share on other sites More sharing options...
unkwntech Posted November 30, 2008 Author Share Posted November 30, 2008 Ahh.... damned python screwing me up. Quote Link to comment https://forums.phpfreaks.com/topic/134893-solved-need-some-more-oop-help/#findComment-702446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.