In this code
$start = $this->getStart();
var_dump($start);
$start->modify('Monday this week');
var_dump($this->getStart());
-
public function getStart()
{
return $this->start;
}
how is it possible, that the second dump actually shows the modified date?
I know that modify operates on the date object itself and not merely returns the new value. But why is the actual object property changed? When I change the value otherwise, e.g.
$start = $this->getStart();
var_dump($start);
$start = false;
var_dump($this->getStart());
two times the same date is dumped, as I would expect.