title: php function undefined when it is defined
body: <p>I am having some problem with scope i assume, but i cannot for the life of me figure out what that problem is...</p>
  
  <p>I keep getting a function undefined error for the following three functions whenever they are called; addUser, removeUser, updatePlayer. Anyone have any idea what's wrong? full code below (it is a pocketmine plugin):</p>
  
  <pre><code>&lt;?php
  
  /*
  __PocketMine Plugin__
  name=X
  description=X
  version=0.0.1
  author=X
  class=X
  apiversion=10
  */
  
  class X implements Plugin {
      private $api;
  
      public $continents = array();
      public $allContinents = array("NA" =&gt; 0, "SA" =&gt; 0, "AF" =&gt; 0, "AS" =&gt; 0, "OC" =&gt; 0, "EU" =&gt; 0);
  
      public function __construct(ServerAPI $api, $server = false){
          $this-&gt;api = $api;
      }
  
      public function init(){
          //Initialize the on player join event handler
          $this-&gt;api-&gt;addHandler("player.spawn", array($this, "onPlayerJoin"));
          $this-&gt;api-&gt;addHandler("player.quit", array($this, "onPlayerQuit"));
  
          //Setup Config
          $this-&gt;path = $this-&gt;api-&gt;plugin-&gt;configPath($this);
          $this-&gt;msgs = new Config($this-&gt;path . "config.yml", CONFIG_YAML, array("AuthToken" =&gt; "", "Delay" =&gt; "5"));
          $this-&gt;msgs = $this-&gt;api-&gt;plugin-&gt;readYAML($this-&gt;path . "config.yml");
  
      }
  
  
  
  
      // &lt;--- updatePlayer ---&gt;
      public function updatePlayer($user) {
  
  
      }
  
      // &lt;--- Country Handler ---&gt;
      public function addUser($user, $continents, $allContinents) {
          $ip = $user-&gt;ip;
          $username = $user-&gt;username;
  
          $gi = geoip_open($this-&gt;path ."GeoIP.dat",GEOIP_STANDARD);
          $continent = geoip_continent_code_by_name($gi, $ip);
  
          array_push($continents, $username);
          $continents[$username] = $continent;
  
          $allContinents[$continent] += 1;
  
                  return $continents;
                  return $allContinents;
      }
  
      public function removeUser($user, $continents, $allContinents) {
              $username = $user-&gt;username;
              $continent = $continents[$username];
              unset($continents[$username]);
  
              $allContinents[$continent] -= 1;
  
              return $continents;
              return $allContinents;
      }
  
  
      // &lt;--- Rquest Ad ---&gt;
      public function requestAd() {
  
      }
  
      /*public function send() {
          while(true) {
              sleep(240);
          }
      }
      }*/
  
      //On player join event handler
      public function onPlayerJoin($user){
  
          $username = $user-&gt;username;
          addUser($user);
          updatePlayer($user);
  
          //Check if plugin is setup
          if ($this-&gt;api-&gt;ban-&gt;isOp($username) &amp;&amp; $this-&gt;msgs["AuthToken"] == "") {
              $this-&gt;api-&gt;chat-&gt;sendTo(false, "Please visit X to setup X.", $username);
          }
      }
  
      public function onPlayerQuit($user){
          removeUser($user);
      }
      public function __destruct(){
      }
  }
  ?&gt;
  </code></pre>