As of PHP 5.4 we can use this kind of syntax:
$oYesterday = (new \DateTime())->modify('-1 day');
So we don't have to create a temp variable. I was wondering why it doesn't work with clone, it leads to a parse error:
$oDayBefore = (clone $oYesterday)->modify('-1 day');
PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)