3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateString = '01-01T23:59'; $defaultLastTicketingDate = new \DateTime('2015-12-31T22:00'); $deadline = new \DateTime($defaultLastTicketingDate->format('Y') . '-' . $dateString); if ($deadline < $defaultLastTicketingDate) { $nextYear = new \DateTime('+1 Year'); $deadline = new \DateTime($nextYear->format('Y') . '-' . $dateString); } echo $deadline->format('c');
based on 4KuHQ
Output for 5.3.19 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
2016-01-01T23:59:00+01:00
Output for 5.5.24 - 5.6.21, 7.0.0 - 7.0.6
2017-01-01T23:59:00+01:00