TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   "$this->" Not in object context? (http://www.talkphp.com/general/2442-not-object-context.html)

Nor 03-09-2008 05:27 PM

"$this->" Not in object context?
 
nvm I was calling the function that was using $this "statically" which I couldn't do.

freenity 03-09-2008 05:48 PM

what???????

to call a statis function: Class::method()
$this can't be used out of the objects context

sjaq 03-09-2008 06:01 PM

If you call a class statically you must use self::myfuncname(); instead of $this->myfuncname();.PHP: Scope Resolution Operator (::) - Manual


All times are GMT. The time now is 11:09 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0