title: Using DateTime as a one-liner in PHP
body: <p>A short and simple question which I couldn't really find an answer for.</p>
  
  <p>In procedural PHP I could echo a date </p>
  
  <pre><code>echo date('Y-m-d'); ?&gt;
  </code></pre>
  
  <p>In Object oriented PHP I have to use two lines</p>
  
  <pre><code>$now = new DateTime();
  echo $now-&gt;format('Y-m-d');
  </code></pre>
  
  <p>Is it possible to do this in one line?</p>