我有PHP 7和我收到以下錯誤:PHP 7棄用構造問題
[25-Feb-2017 01:29:12 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; my_function has a deprecated constructor in /function.php on line 8
class my_function{
...
public function my_function(){}
...
}
更新之前,我從來沒有任何問題。我不知道如何解決這個問題。
有什麼建議嗎?如果我只是改變名字,恐怕會更糟糕。這裏有什麼問題?
謝謝!
替換'公共函數創建my_function()'和'公共職能__construct()' –