Vinze Posted April 25, 2006 Share Posted April 25, 2006 Hey, I got this class (which extends another one, but I don't know if that's relevant), and it has this protected function. That again declares another function which calls $this->somevariable. Now PHP reports the use of $this outside of class scope... How could I fix this? Quote Link to comment https://forums.phpfreaks.com/topic/8352-php-5-function-in-a-function-in-a-class/ Share on other sites More sharing options...
trq Posted April 25, 2006 Share Posted April 25, 2006 Post some code. Quote Link to comment https://forums.phpfreaks.com/topic/8352-php-5-function-in-a-function-in-a-class/#findComment-30627 Share on other sites More sharing options...
Vinze Posted July 31, 2006 Author Share Posted July 31, 2006 I somehow solved this recently (though the question is quite old). I'm not sure what I did, but I think I shouldn't define a funtion in defining a function in defining a class. Quote Link to comment https://forums.phpfreaks.com/topic/8352-php-5-function-in-a-function-in-a-class/#findComment-66457 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.