I have really simple php code:
<?php
date_default_timezone_set('America/New_York');
echo (new DateTime())->format('r');
?>
and when I run it locally (thanks to xampp) it works fine and shows me the time:
Tue, 29 Sep 2015 11:41:35 -0400
but when I put it on my hosting webserver, I get the message:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in (...)/public_html/test/timeoftheserver.php on line 3
what might be the issue?