Re: PHP5 Class problem
| From: | M. Sokolewicz | Date: | Fri, 28 Jan 2005 12:11:24 +0000 |
| Subject: | Re: PHP5 Class problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207580@lists.php.net to get a copy of this message | ||
daniel@electroteque.org wrote:
1. you are calling the method on a object (i.e. not as a static call like SessionHandler::getOrgSession()) 2. the function (method) you are calling is _NOT_ defined as static. in your case you have defined all your methods as static.... so the engine will not make $this available even if you call the method/function on an instantiated object. solution - remove 'static' from the function definitions that you wish to use $this in.how odd, i have assumed having a class static you could still throw around variables inside it, or its only meant to stay in the one static method so executing it like Class::staticMethod(); and Class::otherStaticMethod() ? #2