title: PHP $this variable
body: <p>I am reading some PHP code that I could not understand:</p>
  
  <pre><code>class foo {
    function select($p1, $dbh=null) {
      if ( is_null($dbh) )
          $dbh = $this-&gt;dbh ; 
      return; 
    }
  
    function get() {
      return $this-&gt;dbh; 
    }
  }
  </code></pre>
  
  <p>I can't find <code>$this-&gt;dbh ($dbh)</code> declaration from the class. My questions are: </p>
  
  <ul>
  <li><p>What is the value of <code>$this-&gt;dbh</code> ?</p></li>
  <li><p>Is it a local variable for function <code>select()</code>? </p></li>
  <li><p>Does <code>$this</code> belong <code>class foo</code>'s data member?  Why is there no declaration for <code>$dbh</code> in this class? </p></li>
  </ul>