Issue: https://github.com/php/php-src/issues/8153
Comment Author: hormus
@cmb69 If through diff I create DateInterval or from PHP >= 7.1.7 clone DateInterval
DateInterval::sub works as expected. Maybe from php 8.1 DateInterval gets the reference from some
cache or oblivious even if it is setter afterwards.
`<?php
//PHP >= 7.1.7 clone DateInterval https://bugs.php.net/bug.php?id=70975
$date1 = new \DateTime('2022-03-30 00:00:00.000100', new
\DateTimeZone('Europe/Rome'));
$delta = new \DateInterval('PT0S');
$clone = (clone $delta);
$clone->f = 0.0001;
$date2 = new \DateTime('2022-03-30 00:00:00.000000', new
\DateTimeZone('Europe/Rome'));
$diff = $date2->diff($date1);
$date2->setTimezone(new \DateTimeZone('UTC'));
$date2->sub($clone);
$date1->setTimezone(new \DateTimeZone('UTC'));
$date1->sub($diff);
$date1->sub($diff);
var_dump($date2, $date1, $clone, $diff);`