Verdagon;10900536 wrote:With your code I get this error: PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /Users/Verdagon/Desktop/perello/server/date.php on line 26
Yeah, that was my point.. so when I try:
echo new dateTime()->getOffset();
I get the same problem as you.. but as I just mentioned, I do get results with:
$d = new dateTime();
echo $d->getOffset();
EDIT - So I am guessing you cannot echo out a new class without creating an object first (I've never tried it before coming across this thread). But it doesn't explain why you cannot create an object and echo it out that way..