3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo $phpdate = strtotime('-2 day'); echo PHP_EOL; echo $mysqldate = date('Y-m-d H:i:s', $phpdate); echo PHP_EOL; $last_access = $phpdate; $now = time(); $last_midnight = $now - ($now % (24*60*60)); if ($last_access >= $last_midnight) { print "Today"; } elseif ($last_access >= ($last_midnight-(24*60*60))) { print "Yesterday"; } ?>
Output for 4.3.10 - 4.4.9, 5.0.3 - 5.5.22, 5.5.24 - 7.1.0
1387238233 2013-12-17 00:57:13
Output for 5.5.23
1387238234 2013-12-17 00:57:14
Output for 5.0.2
1387234800 2013-12-17 00:00:00
Output for 5.0.0 - 5.0.1
1387234800 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9UPvb on line 5 PHP_EOL2013-12-17 00:00:00 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9UPvb on line 7 PHP_EOL
Output for 4.3.0 - 4.3.9
1387238233 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9UPvb on line 5 PHP_EOL2013-12-17 00:57:13 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9UPvb on line 7 PHP_EOL