3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($dateAdded,$now){ $secondsInPast = $now->getTimestamp() - $dateAdded->getTimestamp(); if($secondsInPast > 60*60*2){ echo $dateAdded->format('H:n:s'). " Old enough\n"; } else { echo $dateAdded->format('H:n:s'). " Not Old Enough\n"; } } $now = new Datetime('now'); echo "Now:" . $now->format('H:n:s').'\n\n'; check(new DateTime('- 13 seconds'),$now); check(new DateTime('- 13 minutes'),$now); check(new DateTime('- 100 minutes'),$now); check(new DateTime('- 125 minutes'),$now);
Output for git.master, git.master_jit, rfc.property-hooks
Now:18:10:20\n\n18:10:07 Not Old Enough 17:10:20 Not Old Enough 16:10:20 Not Old Enough 16:10:20 Old enough

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:
56.77 ms | 401 KiB | 8 Q