3v4l.org

run code in 300+ PHP versions simultaneously
<?php // chnage this to try different date/times $inactivityTime = '2018-11-05 20:45:45'; $inactivityDateTime = DateTime::createFromFormat('Y-m-d H:i:s', $inactivityTime); $tenMinutesAgo = new DateTime('-10 minutes'); echo "inactivity time was " . (($inactivityDateTime < $tenMinutesAgo) ? "more" : "less") . " than ten minutes ago";
Output for 5.6.38, 7.1.0 - 7.1.23, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12, 8.1rc1 - rc3
inactivity time was more than ten minutes ago

preferences:
28.71 ms | 460 KiB | 5 Q