PHP call Class method / function

后端 未结 7 442
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 10:47

How can I call following Class method or function?

Let say I have this params get from url:

$var = filter($_GET[\'params\']);

7条回答
  •  既然无缘
    2020-12-09 11:24

    As th function is not using $this at all, you can add a static keyword just after public and then call

    Functions::filter($_GET['params']);
    

    Avoiding the creation of an object just for one method call

提交回复
热议问题