Q:

When I add an interval to a datetime, PHP seems to alter other datetime variables. Why?

I don't really know how to ask this.
I have the same date saved in two variables.
Then I add 100 days to the second variable.
But both seem to be altered. Why does that happens?
$begin = new DateTime("20180101");
$end = $begin;
$end = $end->add(new DateInterval('P100D'));

echo $begin->format('Y-m-d') . "<br>";
echo $end->format('Y-m-d');

result is:

2018-04-11
2018-04-11

but I expected:

2018-01-01
2018-04-11

A:

If you want to have different days using the same DateTime object, you have to do this:
$begin = new DateTime("20180101");
$end = clone $begin;
$end = $end->add(new DateInterval('P100D'));

echo $begin->format('Y-m-d') . "<br>";
echo $end->format('Y-m-d');

And as of why: PHP is using the same object by reference...
If you create two different objects DateTime by new DateTime('pattern') it will behave perfectly ok.
The behaviour you are seeing now can be observed like this also:
$test = new stdClass();
$test->sample = "What!?";

$another = $test;
$another->sample = "Impossibru!";

echo $another->sample . "<br>";
echo $test->sample . "<br>";

