PHP Using a variable when calling a static method

后端 未结 5 645
故里飘歌
故里飘歌 2021-01-14 01:55

I have three classes that all have a static function called \'create\'. I would like to call the appropriate function dynamically based on the output from a form, but am hav

5条回答
  •  耶瑟儿~
    2021-01-14 02:37

    I believe this can only be done since PHP 5.3.0. Check this page and search for $classname::$my_static to see the example.

提交回复
热议问题