SharkBait Posted August 23, 2010 Share Posted August 23, 2010 For some reason I cannot think today. <?php class { function meh() { $blah = $this->profile(); echo $blah->weirdname; } function profile() { // this is where I'm stuck.. // how do I properly set weirdname? } } ?> It's been a while since I've played with classes (been doing other things) so how do I set up the function profile() to return a value for weirdname. Quote Link to comment https://forums.phpfreaks.com/topic/211551-brain-fart/ Share on other sites More sharing options...
Alex Posted August 23, 2010 Share Posted August 23, 2010 The profile() method would have to return an object that has a public property named weirdname. Quote Link to comment https://forums.phpfreaks.com/topic/211551-brain-fart/#findComment-1102879 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.