3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo $phpdate = strtotime('-1 day'); echo PHP_EOL; $mysqldate = date('Y-m-d H:i:s', $phpdate); $phpdate = time(); echo $last_midnight = $phpdate - ($phpdate % (24*60*60)); if ($last_access >= $last_midnight) { print "Today"; } elseif ($last_access >= ($last_midnight-(24*60*60))) { print "Yesterday"; } ?>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1387317874 1387324800 Notice: Undefined variable: last_access in /in/vDH6c on line 14 Notice: Undefined variable: last_access in /in/vDH6c on line 18
Output for 4.3.10 - 4.4.9, 5.0.3
1387317874 1387324800 Notice: Undefined variable: last_access in /in/vDH6c on line 14 Notice: Undefined variable: last_access in /in/vDH6c on line 18
Output for 5.0.2
1387234800 1387324800 Notice: Undefined variable: last_access in /in/vDH6c on line 14 Notice: Undefined variable: last_access in /in/vDH6c on line 18
Output for 5.0.0 - 5.0.1
1387234800 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vDH6c on line 5 PHP_EOL1387324800 Notice: Undefined variable: last_access in /in/vDH6c on line 14 Notice: Undefined variable: last_access in /in/vDH6c on line 18
Output for 4.3.0 - 4.3.9
1387317874 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/vDH6c on line 5 PHP_EOL1387324800 Notice: Undefined variable: last_access in /in/vDH6c on line 14 Notice: Undefined variable: last_access in /in/vDH6c on line 18