3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timezone = new DateTimeZone( "UTC" ); $fmj = DateInterval::createFromDateString( 'first Monday of January next year' ); //Monday from start 2019 only $period = new DatePeriod( new DateTime( '2019-01-01 00:00:00.000000', $timezone ), $fmj, new DateTime( '2022-01-11 00:00:00.000000', $timezone ) ); //$period->current= new \DateTime('2019-05-06 00:00:00', new \DateTimeZone('UTC')); $y = 0; foreach ( $period as $dt ) { $c[] = $period; $display[$y++] = $dt->format( "l Y-m-d H:i:s" ); //stop total_recurrence if( $y == 5 ) { break; } } $var = new DateTime( 'first monday of January', new DateTimeZone( "UTC" )); $display[5] = $var->format( "l Y-m-d H:i:s" ); var_dump( $display, $fmj, $c);

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)
8.1.100.0040.00417.81
8.1.90.0000.00917.62
8.1.80.0020.00817.78
8.1.70.0000.00717.83
8.1.60.0060.00617.73
8.1.50.0030.00617.64
8.1.40.0030.00917.80
8.1.30.0000.00817.82
8.1.20.0070.00317.87
8.1.10.0080.00017.79
8.1.00.0000.00817.77
8.0.230.0040.00417.27
8.0.220.0040.00417.24
8.0.210.0000.00817.08
8.0.200.0070.00017.30
8.0.190.0030.00617.16
8.0.180.0000.01017.27
8.0.170.0030.00617.24
8.0.160.0040.00417.16
8.0.150.0070.00317.19
8.0.140.0040.00417.24
8.0.130.0060.00013.63
8.0.120.0030.00617.23
8.0.110.0040.00416.99
8.0.100.0050.00317.06
8.0.90.0040.00417.16
8.0.80.0110.01117.17
8.0.70.0350.00317.23
8.0.60.0330.01216.96
8.0.50.0250.01217.12
8.0.30.0240.01217.20
8.0.20.0280.01317.27
8.0.10.0320.00917.38
8.0.00.0120.01517.30
7.4.300.0030.00616.77
7.4.290.0000.00816.70
7.4.280.0050.00316.80
7.4.270.0000.00816.79
7.4.260.0000.00816.84
7.4.250.0080.00016.82
7.4.240.0000.00816.88
7.4.230.0080.00016.67
7.4.220.0120.01216.82
7.4.210.0270.01216.74
7.4.200.0310.00916.82
7.4.190.0240.01316.79
7.4.180.0210.01516.89
7.4.160.0250.01716.83
7.4.150.0230.01116.84
7.4.140.0310.00916.77
7.4.130.0300.02016.80
7.4.120.0280.01716.70
7.4.110.0230.01316.69
7.4.100.0300.01516.72
7.4.90.0340.01416.73
7.4.80.0410.01616.61
7.4.70.0250.01516.55
7.4.60.0340.02116.70
7.4.50.0340.02616.56
7.4.40.0330.01116.65
7.4.30.0280.00916.76
7.4.20.0270.01516.84
7.4.10.0230.01616.71
7.4.00.0260.01216.70
7.3.330.0070.00016.79
7.3.320.0030.00313.55
7.3.310.0000.00716.75
7.3.300.0040.00416.74
7.3.290.0320.00516.64
7.3.280.0240.01216.60
7.3.270.0280.01416.64
7.3.260.0290.01316.57
7.3.250.0360.01016.64
7.3.240.0250.01716.61
7.3.230.0290.01316.56
7.3.220.0290.00516.56
7.3.210.0230.01416.56
7.3.200.0300.00516.54
7.3.190.0230.01716.59
7.3.180.0240.00816.48
7.3.170.0200.01416.53
7.3.160.0230.01716.50
7.3.150.0300.01416.57
7.3.140.0200.02116.57
7.3.130.0240.01416.60
7.3.120.0290.00616.56
7.3.110.0280.01116.54
7.3.100.0260.01316.41
7.3.90.0350.00616.83
7.3.80.0230.01116.45
7.3.70.0280.00716.62
7.3.60.0270.00916.57
7.3.50.0250.01016.66
7.3.40.0220.01216.63
7.3.30.0230.01516.66
7.3.20.0170.01716.68
7.3.10.0310.00716.69
7.3.00.0160.02016.61

preferences:
13.22 ms | 406 KiB | 5 Q