3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set( 'UTC' ); define( "TIMESTAMP_FORMAT", "Y-m-d G:i:s" ); $aString = "2017-03-01 23:11:16"; echo "String to convert: ". $aString ."\r\n"; $currentTime = date( TIMESTAMP_FORMAT ); echo "Current Time: ". $currentTime."\r\n"; $dateToCheck = new DateTime($aString); echo "Date To Check: ". $dateToCheck->format(TIMESTAMP_FORMAT)."\r\n"; if($dateToCheck < $currentTime) { echo 'Date is in the past'; } else { echo 'Date is in the future'; }
Output for rfc.property-hooks, git.master, git.master_jit
String to convert: 2017-03-01 23:11:16 Current Time: 2019-06-11 8:44:39 Date To Check: 2017-03-01 23:11:16 Date is in the future

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:
37.77 ms | 1794 KiB | 4 Q