3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo $phpdate = strtotime('+2 day'); echo PHP_EOL; echo $mysqldate = date('Y-m-d H:i:s', $phpdate); echo PHP_EOL; function formatDate($timestamp) { if ($timestamp >= strtotime('today')) { return 'Today'; } elseif ($timestamp >= strtotime('yesterday')) { return 'Yesterday'; } else { return date('M j, Y', $date); } } echo formatDate($phpdate); /*$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"; } else{print 'AAAA';} */ ?>
Output for git.master, git.master_jit, rfc.property-hooks
1387584993 2013-12-21 01:16:33 Today

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.8 ms | 401 KiB | 8 Q