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


this question has answer here:

class affiliates_shortcodes {      private $earnings;       public static function affiliates_user_tree() {  echo $this->earnings;          }        } 

getting error:

fatal error: uncaught error: using $this when not in object context

your method declared static. can't use object properties within static methods. see http://php.net/manual/en/language.oop5.static.php


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -