title: With statement in php
body: <p>I am wondering if there is something similar to javascript or VB's <code>with</code> statement but in php</p>
  
  <p>The way this works, for example in VB is shown below. The two code snippets do the same effect: </p>
  
  <pre><code>array[index].attr1 = val1;
  array[index].attr2 = val2;
  array[index].attr3 = val3;
  </code></pre>
  
  <p>is equal to :</p>
  
  <pre><code>With(array[index])
      .attr1 = val1
      .attr2 = val2
      .attr3 = val3
  End With
  </code></pre>