title: PHP object class variable
body: <p>I have built a class in PHP and I must declare a class variable as an object. Everytime I want to declare an empty object I use:</p>
  
  <pre><code>$var=new stdClass;
  </code></pre>
  
  <p>But if I use it to declare a class variable as</p>
  
  <pre><code>class foo
  {
      var $bar=new stdClass;
  }
  </code></pre>
  
  <p>a parse error occurs. Is there a way to do this or must I declare the class variable as an object in the constructor function?</p>
  
  <p>PS: I'm using PHP 4.</p>