2017-08-21 16 views
-2
class Affiliates_Shortcodes { 

    private $earnings; 


    public static function affiliates_user_tree() { 

echo $this->earnings; 

     } 
    } 

入門錯誤:

Fatal error: Uncaught Error: Using $this when not in object context

+4

靜態函數與對象無關,所以不能在任何靜態上下文中使用$ this。 – xander

+0

所以如何訪問它 –

+1

'echo self :: earnings' - 但$收益必須聲明爲static! – Jeff

回答

相關問題