You are here: Static method vs Non Static method « PHP Programming Language « IT news, forums, messages
Static method vs Non Static method

Posted by gg9h0st on 05/26/06 11:36

i really wander what makes static method special?

in fact i can access a non static method statically using '::'

class aclass {
function anonstatic() {
echo 'non static';
}

static function astatic() {
echo 'static';
}
}

$aobj = new aclass();

aclass::anonstatic();
//it works.

$aobj->astatic();
//it works too.

i see a diffrence that i can't use $this in static method but nothing.

i don't feel there's no reason i have to make a mothod static.

is there any reason i have to declare a mothod as static?

apache2.0/php5.14

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация