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 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. 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 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. 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. 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. 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
Archived
This topic is now archived and is closed to further replies.