3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(gmdate('Y-m-d H:i:s')); $SubscriptionsChangesLastRequest = (string)$now->format('Y-m-d H:i:s'); if (isset($request->Data->LastDate)) { try { $tmp = new DateTime($request->Data->LastDate); $LastDate = (string)$tmp->format('Y-m-d H:i:s'); } catch (Exception $e) { $LastDate = $SubscriptionsChangesLastRequest; } } if (!isset($LastDate) && isset($_SESSION['SubscriptionsChangesLastRequest'])) { $LastDate = $_SESSION['SubscriptionsChangesLastRequest']; } else { $now->sub(new DateInterval('P1DT15M')); $LastDate = (string)$now->format('Y-m-d H:i:s'); } echo $LastDate;
Output for 5.6.30, hhvm-3.18.4 - 3.20.2, hhvm-3.21.3, 7.0.0 - 7.2.9
2017-07-11 06:00:30
Output for hhvm-3.15.4, hhvm-3.21.0, hhvm-3.22.0
2017-07-11 06:00:31