title: Declaring variable vars inside a PHP class?
body: <p>I am a noob with OOP, and would appreciate some help on what must be an exceedingly simple problem.</p>
  
  <p>In non-OOP PHP, I would do this:</p>
  
  <pre><code>$fruit = banana;
  
  function showFruit(){
    global $fruit;
    echo $fruit;    
  }
  </code></pre>
  
  <p>This would print "banana", and I could define the variable outside of the function without issue.</p>
  
  <p>How about in a class?</p>
  
  <pre><code>$fruit = "apple";
  
  class showFruit(){
    var $string = ?????;
    // Functions here...
  }
  </code></pre>
  
  <p>Thanks!</p>