public function testAddImmutable() { $dateInterval = new \DateInterval('P2D'); $a = new DateTime("2009-12-12"); $b = $a->add($dateInterval); $this->assertNotSame($a, $b); $this->assertEquals('2009-12-12', $a->format('Y-m-d')); $this->assertEquals('2009-12-14', $b->format('Y-m-d')); }