0

I'm studying php and I made this code:

$a = new DateTime('NOW');

$b = $a;

$b->modify("+1 day");

echo "<pre>";

print_r($a);    

print_r($b);

And in both my print_r the results are the same, this:

DateTime Object
(
    [date] => 2017-12-29 15:05:27.000000
    [timezone_type] => 3
    [timezone] => America/Sao_Paulo
)
DateTime Object
(
    [date] => 2017-12-29 15:05:27.000000
    [timezone_type] => 3
    [timezone] => America/Sao_Paulo
)

Why is that?

Stordon
  • 11
  • 6

0 Answers0