title: Initialize Objects like arrays in PHP?
body: <p>In PHP, you can initialize arrays with values quickly using the following notation:</p>
  
  <pre><code>$array = array("name" =&gt; "member 1", array("name" =&gt; "member 1.1") ) ....
  </code></pre>
  
  <p>is there any way to do this for STDClass objects?
  I don't know any shorter way than the dreary</p>
  
  <pre><code>$object = new STDClass();
  $object-&gt;member1 = "hello, I'm 1";
  $object-&gt;member1-&gt;member1 = "hello, I'm 1.1";
  $object-&gt;member2 = "hello, I'm 2";
  </code></pre>