title: PHP - Call to undefined function when it is defined
body: <p>My problem is that I have two functions and I try to call one in the other but I get the error it is undefined. Here is my code:</p>
  
  <pre><code>        class LoggedUser extends User {
  public function rrmdir($dir) {
         if (is_dir($dir)) {
           $objects = scandir($dir);
           foreach ($objects as $object) {
             if ($object != "." &amp;&amp; $object != "..") {
               if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
             }
           }
           reset($objects);
           rmdir($dir);
         }
       }
  
      public function usunGalerie($galeria,$log,$folder){
          require_once('db_connect.inc');
          $query = "DELETE FROM galery WHERE Nazwa='$galeria' AND Autor='$log';";
          $result = @mysql_query($query);
          if(!$result = mysql_query($query))
              {
                  echo '&lt;code&gt;$query&lt;/code&gt; &amp;rarr; '.mysql_error().' ('.mysql_errno().')';
  
              }
          $query = "DELETE FROM zdjecie WHERE Galeria='$galeria' AND Autor='$log';";
          $result2 = @mysql_query($query);
          if ($result &amp;&amp; $result2) {          
                  echo 'Usunięto galerię '.$galeria;
                  $this-&gt;rrmdir($folder);
              } else {
                  echo 'Wystąpił błąd.';
              }
      }
  }
  </code></pre>
  
  <p>then I get: Call to undefined function rrmdir()
  I tried to call it without $this-> but it's the same.</p>
  
  <p>Please can anyone help me?</p>