Re: Class not used as an object (Scope Resolution Operator)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All of the above with a clarification: they are instance methods which you
are calling statically. The object is not instantiated in this case. PHP
allows this but will issue an E_STRICT warning. To remove the warning just
add "static" before each of them, assuming they are only ever called
statically:

class myClass {
       static function &doThis($passedVar) {
               doSomething;
       }

       static function &doThat($anotherVar) {
               doSomethingElse;
       }
}

David

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux