3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $baseDate = new DateTime('2017-01-01', new DateTimezone('UTC')); $endDate = clone $baseDate; for($i = 1; $i <= 5; ++$i) { $duration = new DateInterval("PT{$i}H"); $baseDate->add($duration); var_dump($baseDate); var_dump($endDate); }
based on Top86