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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -