3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datestr = 'Fri, 28 Feb 2020 19:18:26 +010'; $date = new DateTime($datestr); $tz = preg_match('/([+-]\d+)$/', $datestr, $m) ? $m[0] : ''; $now = new DateTime(date('Y-m-d H:i:s ' . $tz)); $now->modify('-1 day'); if ($now > $date) { echo "$datestr is more than 1 day ago\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Fri, 28 Feb 2020 19:18:26 +010 is more than 1 day ago

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:
29.79 ms | 405 KiB | 5 Q