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(); echo $last_midnight = $now - ($now % (24*60*60)); echo PHP_EOL; echo strtotime('today'); echo PHP_EOL; if ($last_access >= $last_midnight) { print "Today"; } elseif ($last_access >= ($last_midnight-(24*60*60))) { print "Yesterday"; } else{print 'AAAA';} ?>
Output for 5.1.0 - 7.1.0
1387585104 2013-12-21 01:18:24 1387411200 1387407600 Today
Output for 4.3.10 - 4.4.9, 5.0.3 - 5.0.5
1387585104 2013-12-21 01:18:24 1387411200 1387412304 Today
Output for 5.0.2
1387580400 2013-12-21 00:00:00 1387411200 1387407600 Today
Output for 5.0.0 - 5.0.1
1387580400 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 5 PHP_EOL2013-12-21 00:00:00 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 7 PHP_EOL1387411200 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 16 PHP_EOL1387407600 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 18 PHP_EOLToday
Output for 4.3.0 - 4.3.9
1387585104 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 5 PHP_EOL2013-12-21 01:18:24 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 7 PHP_EOL1387411200 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 16 PHP_EOL1387412304 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/2cij7 on line 18 PHP_EOLToday