title: PHP syntax to call methods on temporary objects
body: <p>Is there a way to call a method on a <strong>temporary declared object</strong> without being forced to assign 1st the object to a variable?</p>
  
  <p>See below:</p>
  
  <pre><code>class Test
  {
     private $i = 7;      
     public function get() {return $this-&gt;i;}   
  }
  
  $temp = new Test();
  echo $temp-&gt;get(); //ok
  
  echo new Test()-&gt;get(); //invalid syntax
  echo {new Test()}-&gt;get(); //invalid syntax
  echo ${new Test()}-&gt;get(); //invalid syntax
  </code></pre>