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 wednesday 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.0000.01217.25
7.2.20.0520.01617.92
7.2.10.0440.00717.63
7.2.00.0510.00417.80
7.1.200.0030.00515.63
7.1.140.0370.00716.71
7.1.130.0430.01216.70
7.1.120.0350.01516.93
7.1.110.0320.01316.07
7.1.100.0390.00715.99
7.1.90.0320.01116.42
7.1.80.0280.01216.41
7.1.70.0260.01315.53
7.1.60.0380.01433.32
7.1.50.0410.02133.17
7.1.40.0400.01632.76
7.1.30.0800.01433.12
7.1.20.0540.00332.87
7.1.10.0500.01314.98
7.1.00.0210.01415.09

preferences:
33.99 ms | 400 KiB | 5 Q