I have a question regarding static function in php.
let's assume that I have a class
class test {
public function sayHi() {
echo 'hi';
}
}
if I do test::sayHi();
it works without a problem.
class test {
public static function sayHi() {
echo 'hi';
}
}
test::sayHi();
works as well.
What are the differences between first class and second class?
What is special about a static function?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…