3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time_str = '1:47 PM'; $tz_str = 'America/New_York'; $timestamp = time(); $datetime = new DateTime("now", new DateTimeZone($tz_str)); //first argument "must" be a string $datetime->setTimestamp($timestamp); //adjust the object to correct timestamp //$datetime = new DateTime( '2010-05' ); $datetime->modify( 'first day of +0 month' ); echo $datetime->format( 'F' ), "\n"; echo $datetime->format('w d.m.Y, H:i:s') . "\n"; echo $datetime->format('m.Y') . "\n"; $datetime->modify( 'fourth thursday of +0 month' ); echo $datetime->format( 'F' ), "\n"; echo $datetime->format('w d.m.Y, H:i:s') . "\n"; echo $datetime->format('m.Y') . "\n"; $datetime->modify( 'first day of +1 month' ); echo $datetime->format( 'F' ), "\n"; echo $datetime->format('w d.m.Y, H:i:s') . "\n"; echo $datetime->format('m.Y') . "\n"; $datetime->modify('+1 day' ); echo $datetime->format( 'F' ), "\n"; echo $datetime->format('w d.m.Y, H:i:s') . "\n"; echo $datetime->format('m.Y') . "\n"; $datetime->modify('last day of previous month')->modify('+10 day'); echo $datetime->format( 'F' ), "\n"; echo $datetime->format('w d.m.Y, H:i:s') . "\n"; echo $datetime->format('m.Y') . "\n"; $datetime->format('2000-12-10');

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0040.01117.34
7.2.20.0390.01317.95
7.2.10.0240.01618.21
7.2.00.0240.01718.23
7.1.200.0080.00415.71
7.1.140.0310.00816.79
7.1.130.0260.01816.59
7.1.120.0310.00916.82
7.1.110.0270.01015.88
7.1.100.0290.00316.07
7.1.90.0260.00716.36
7.1.80.0370.01216.41
7.1.70.0270.00815.45
7.1.60.0380.01033.48
7.1.50.0390.00833.08
7.1.40.0360.01132.84
7.1.30.0440.01132.93
7.1.20.0620.00732.86
7.1.10.0220.01315.19
7.1.00.0220.00715.20

preferences:
27.8 ms | 401 KiB | 5 Q