title: Setting public class variables
body: <p>How do I set a public variable. Is this correct?:</p>
  
  <pre><code>class Testclass
  {
    public $testvar = "default value";
  
    function dosomething()
    {
      echo $this-&gt;testvar;
    }
  }
  
  $Testclass = new Testclass();
  $Testclass-&gt;testvar = "another value";    
  $Testclass-&gt;dosomething();
  </code></pre>