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); function get_day_name($timestamp) { $date = date('d/m/Y', $timestamp); if($date == date('d/m/Y')) { $day_name = 'Today'; } else if($date == date('d/m/Y',time() - (24 * 60 * 60))) { $day_name = 'Yesterday'; } return $day_name; } print date('G:i:s', $phpdate).' '.get_day_name($phpdate); ?>
Output for 4.3.10 - 4.4.9, 5.0.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1387318534 23:15:34 Yesterday
Output for 5.0.2
1387234800 0:00:00 Yesterday
Output for 5.0.0 - 5.0.1
1387234800 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/kOmJh on line 5 PHP_EOL0:00:00 Yesterday
Output for 4.3.0 - 4.3.9
1387318534 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/kOmJh on line 5 PHP_EOL23:15:34 Yesterday