Why does php datetime diff depend on time zones?
<p>See the following code:</p>

<pre class="lang-php prettyprint-override"><code>function printDiff($tz) {
    $d1 = new DateTime("2015-06-01", new DateTimeZone($tz));
    $d2 = new DateTime("2015-07-01", new DateTimeZone($tz));
    $diff = $d1-&gt;diff($d2);
    print($diff-&gt;format("Year: %Y Month: %M Day: %D"). PHP_EOL);
}
printDiff("UTC");
printDiff("Australia/Melbourne");
</code></pre>

<p>The result is:</p>

<pre><code>Year: 00 Month: 01 Day: 00
Year: 00 Month: 00 Day: 30
</code></pre>

<p>Questions:</p>

<ul>
<li>How can the difference between the same day of two adjacent months (1st of June and July) be different than 1 month?</li>
<li>Why does the computation mode depend on which timezone I use if there is no DST between the given days, there is no leap year, there is nothing special? </li>
<li>Where can I find the exact description of the algorithm how the difference is computed?</li>
</ul>