Re: a interesting direction about Class in PHP.

From: Date: Tue, 19 Dec 2000 12:50:24 +0000
Subject: Re: a interesting direction about Class in PHP.
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-4538@lists.php.net to get a copy of this message
This (static class method calls through classname::methodname) has been in PHP 4 for quite some time. Yes, it's one of MANY (yet) undocumented features, and undocumented features is among the reasons why I'm subscribed to php-windows, php-general, and php-dev, among other things... At 17:16 18.12. 2000, Adam Bear wrote the following: -------------------------------------------------------------- > Maybe I should not post this message in PHP-windowss list, but >I only work on windows and only subscribed this list.so it would >be appreciated if some one repost this message in other list. > Today,when I run the test sample in source code of PHP,I found >a interesting direction to use class method, see the following code: ><? class foo { > var $hahaha; > function foo() { > print "I am foo\n"; > } > function bar() { > print "Hey there!\n"; > } > }; > class foo2 extends foo{ > function foo2(){ > print "Het I am in foo2\n"; > } > } > foo::bar() //haha, can't image we can use "::" operator in PHP! > foo2::bar() //even in a descended class can call his father's method. >?> > > This is really true, all code above is tested by me in PHP4.04b and PHP4.0.1, >I think it can work in versions above PHP4. > This direction more like the static method calls in C++,it is very useful in >OO program,we can use a class method directly without create a object instance of >the class. > I search through the documents of PHP but can't find a word about this operator, >maybe PHP developer term think this operator useless in PHP or maybe this is a future >feature which will be full supported in the next version of PHP. > I am a chinese so sorry for my pool english. Enjoy youself. > >Sincerely > > Adam Bear > &&&&&&&&&&&& > \~~~~~~~~/ > ( $ $ ) > { "" } >=======================oOOo----()-----oOOo======== > Wow.... Gold is there! > +-----------------------------------------------+ > | My E-Mail ====> xcbear@netease.com > or bbbbear@china.com > +----------------------------------Oooo-----------+ > oooO ( ) > ( ) ) / > \ ( (_/ > \_) > > > > > > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net >For additional commands, e-mail: php-windows-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. cynic@mail.cz ICQ: 2808 2505

« previous php.windows (#4538) next »