Jump to content


Photo

[PHP 5] Function in a function in a class


  • Please log in to reply
2 replies to this topic

#1 Vinze

Vinze
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 25 April 2006 - 10:40 AM

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?
WTH? I became a guru by asking questions!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 April 2006 - 04:53 PM

Post some code.

#3 Vinze

Vinze
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 31 July 2006 - 04:52 PM

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.
WTH? I became a guru by asking questions!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users