Does static method in PHP have any difference with non-static method?

前端 未结 6 864
我寻月下人不归
我寻月下人不归 2020-12-03 08:21
class t {
    public function tt()
    {
        echo 1;
    }
}
t::tt();

See?The non-static function can also be called at class level.So what\'s

6条回答
  •  情深已故
    2020-12-03 08:57

    Besides the syntax and functional differences there is also a performance difference that matters.

    You can refer to this more or less detailed comparison of static and non-static methods in PHP.

提交回复
热议问题