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 tuesday 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";

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.0070.00717.05
7.2.20.0370.01318.11
7.2.10.0310.00918.23
7.2.00.0570.01717.69
7.1.200.0000.01215.80
7.1.140.0330.01017.03
7.1.130.0470.00716.88
7.1.120.0470.01016.97
7.1.110.0320.01116.05
7.1.100.0350.00616.27
7.1.90.0440.00316.39
7.1.80.0340.00916.41
7.1.70.0380.00615.66
7.1.60.0500.00733.54
7.1.50.0460.01333.31
7.1.40.0410.01732.86
7.1.30.0780.01233.04
7.1.20.0470.01132.97
7.1.10.0270.01515.05
7.1.00.0400.00315.20

preferences:
31.93 ms | 400 KiB | 5 Q