Jump to content

$this when not in object context


php_nub_qq

Recommended Posts

	public static $info=array();
	private static $instance=null;

	public static function _new($fields = null){
		if(self::$instance == null){
			self::$instance = new User();
		}
		
		if(!empty($fields) && !empty(self::$info['id'])){
			self::$info = $this->getUserInfo(self::$info['id'], $fields);
		}		
		
		return self::$instance;
	}

self::$info = $this->getUserInfo(self::$info['id'], $fields);

 

This is the line where I get

 

Fatal error: Using $this when not in object context "

 

Why is that? 

Link to comment
https://forums.phpfreaks.com/topic/277842-this-when-not-in-object-context/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.