RE: calling static method within class

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

 



If you're expecting the statement 

Echo Foo::getUs(); 

To echo "me& me" it will not because you never returned $us from the
getUs() method. I'm assuming also that xxx is a variable to mean "some
class library" correct?

Carlo Razzeto
Programmer
Mortgage Information Services
Phone: (216) 514-1025 ex. 1212

-----Original Message-----
From: blackwater dev [mailto:blackwaterdev@xxxxxxxxx] 
Sent: Friday, October 28, 2005 1:13 PM
To: php-general@xxxxxxxxxxxxx
Subject:  calling static method within class

I have a class that won't be instantiated...so basically just a bunch
of static methods.

How do I call one of the class' static methods from within another
method?  Can't use this, and self doesn't work...this is php4.

Thanks.

Class Foo{

   function getMe(){
    return "me";

  }

  function getUs(){
   $us=xxx::getMe();
   $us.="& me";

  }
}

echo Foo::getUs();

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Disclaimer: This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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