RE: [PHP] calling static method within class
| From: | Carlo Razzeto | Date: | Fri, 28 Oct 2005 19:42:15 +0000 |
| Subject: | RE: [PHP] calling static method within class | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224791@lists.php.net to get a copy of this message | ||
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@gmail.com]
Sent: Friday, October 28, 2005 1:13 PM
To: php-general@lists.php.net
Subject: [PHP] 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.