title: Issue when converting Carbon::now() toDateTimeString() in Laravel
body: <p>In my code I have a section like this.</p>
  
  <pre><code>-&gt;whereDate('published_at', '&lt;=', (Carbon::now())-&gt;toDateTimeString())
  </code></pre>
  
  <p>This query worked fine in my development machine(homestead) so I pushed it it to dev server(aws).</p>
  
  <p>But I got an issue saying. </p>
  
  <blockquote>
    <p>syntax error, unexpected '->' (T_OBJECT_OPERATOR)</p>
  </blockquote>
  
  <p>However I tackled this issue and found the issue. I wanted to change the query like</p>
  
  <pre><code>-&gt;whereDate('published_at', '&lt;=', Carbon::now()-&gt;toDateTimeString())
  </code></pre>
  
  <p>Only difference is instead of using <code>(Carbon::now())-&gt;toDateTimeString())</code>, now I use <code>Carbon::now()-&gt;toDateTimeString())</code> without the surrounding brackets. Now In both environments my code works.</p>
  
  <p>PHP versions in Homsetead and Aws as follows, </p>
  
  <p>output of <code>php -v</code> on Homestead</p>
  
  <pre><code>PHP 7.1.0-2+deb.sury.org~xenial+1 (cli) ( NTS )
  </code></pre>
  
  <p>output of <code>php -v</code> on aws</p>
  
  <pre><code>PHP 5.6.29 (cli) (built: Jan 18 2017 19:08:44) 
  </code></pre>
  
  <p>I only can think of occurring this issue is due to the difference of php version.</p>
  
  <p><strong>But it confuses me how removing surrounding brackets made my code work. Appreciate your input on this. Thanks!</strong></p>