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',now() - (24 * 60 * 60))) { $day_name = 'Yesterday'; } return $date; } print date('G:i:s', $phpdate).' '.get_day_name($phpdate); ?>
Output for 7.0.0 - 7.1.0
1387318486 Fatal error: Uncaught Error: Call to undefined function now() in /in/9bCgG:13 Stack trace: #0 /in/9bCgG(18): get_day_name(1387318486) #1 {main} thrown in /in/9bCgG on line 13
Process exited with code 255.
Output for 5.0.3 - 5.6.28
1387318486 Fatal error: Call to undefined function now() in /in/9bCgG on line 13
Process exited with code 255.
Output for 5.0.2
1387234800 Fatal error: Call to undefined function now() in /in/9bCgG on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.1
1387234800 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9bCgG on line 5 PHP_EOL Fatal error: Call to undefined function now() in /in/9bCgG on line 13
Process exited with code 255.
Output for 4.4.5 - 4.4.9
1387318486 Fatal error: Call to undefined function: now() in /in/9bCgG on line 13
Process exited with code 255.
Output for 4.3.10 - 4.4.4
1387318486 Fatal error: Call to undefined function: now() in /in/9bCgG on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.9
1387318486 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9bCgG on line 5 PHP_EOL Fatal error: Call to undefined function: now() in /in/9bCgG on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
1387318486 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9bCgG on line 5 PHP_EOL Fatal error: Call to undefined function: now() in /in/9bCgG on line 13