3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Wrong DateInterval first Monday of January 2020, it progress year (+1, +2, etc) not have start or end this class. $timezone = new DateTimeZone( "UTC" ); $fmj = DateInterval::createFromDateString( 'first Monday of next month' ); $period = new DatePeriod( new DateTime( '2019-01-01 00:00:00.000000', $timezone ), $fmj, new DateTime( '2022-01-11 00:00:00.000000', $timezone ) ); $y = 0; foreach ( $period as $dt ) { $c[] = $period; $display[$y++] = $dt->format( "l Y-m-d H:i:s" ); //stop total_recurrence if( $y == 36 ) { break; } } $var = new DateTime( 'first monday of January', new DateTimeZone( "UTC" )); $display[36] = 'this relative date for DateTime class ' . ($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.3.70.0160.01016.75
8.3.60.0200.00718.61
8.3.50.0220.00616.88
8.3.40.0200.00719.04
8.3.30.0230.00719.09
8.3.20.0030.01024.18
8.3.10.0090.00624.66
8.3.00.0070.00726.16
8.2.180.0140.01425.92
8.2.170.0280.00019.16
8.2.160.0370.00322.96
8.2.150.0060.00625.66
8.2.140.0090.00624.66
8.2.130.0120.00326.16
8.2.120.0110.00421.03
8.2.110.0070.01022.39
8.2.100.0150.00718.28
8.2.90.0100.00318.00
8.2.80.0060.00618.98
8.2.70.0060.00617.87
8.2.60.0090.00318.18
8.2.50.0080.00318.07
8.2.40.0040.00820.09
8.2.30.0070.00418.38
8.2.20.0040.00718.24
8.2.10.0120.00019.44
8.2.00.0110.00019.46
8.1.280.0100.02025.92
8.1.270.0100.00723.99
8.1.260.0160.00026.35
8.1.250.0100.00628.09
8.1.240.0110.00720.79
8.1.230.0150.00618.02
8.1.220.0070.00418.04
8.1.210.0090.00318.77
8.1.200.0000.01717.72
8.1.190.0090.00317.73
8.1.180.0040.00818.10
8.1.170.0040.00818.95
8.1.160.0090.00319.00
8.1.150.0030.00819.10
8.1.140.0040.00719.04
8.1.130.0090.00320.34
8.1.120.0110.00017.77
8.1.110.0090.00317.79
8.1.100.0030.00917.63
8.1.90.0000.01317.66
8.1.80.0030.00817.79
8.1.70.0060.00617.81
8.1.60.0060.00617.88
8.1.50.0080.00417.81
8.1.40.0090.00317.75
8.1.30.0000.01317.90
8.1.20.0040.00817.90
8.1.10.0090.00317.83
8.1.00.0080.00417.82
8.0.300.0000.01118.90
8.0.290.0040.00917.13
8.0.280.0040.00718.63
8.0.270.0110.00018.25
8.0.260.0070.00318.71
8.0.250.0130.00317.28
8.0.240.0070.00717.30
8.0.230.0000.01117.29
8.0.220.0000.01017.16
8.0.210.0040.00717.07
8.0.200.0060.00617.33
8.0.190.0000.01217.31
8.0.180.0030.00817.23
8.0.170.0070.00717.25
8.0.160.0120.00017.17
8.0.150.0100.00317.09
8.0.140.0070.00417.23
8.0.130.0070.00413.72
8.0.120.0060.00617.27
8.0.110.0070.00417.17
8.0.100.0000.01017.02
8.0.90.0040.00717.10
8.0.80.0540.01517.07
8.0.70.0470.02617.14
8.0.60.0190.03117.08
8.0.50.0410.02717.13
8.0.30.0310.02417.08
8.0.20.0290.02117.20
8.0.10.0170.02817.20
8.0.00.0550.02017.24
7.4.330.0040.00415.55
7.4.320.0060.00616.68
7.4.300.0090.00616.82
7.4.290.0070.00416.77
7.4.280.0070.00716.93
7.4.270.0060.00616.85
7.4.260.0060.00613.63
7.4.250.0070.00716.79
7.4.240.0070.00416.80
7.4.230.0110.00016.82
7.4.220.0260.02916.66
7.4.210.0170.03316.89
7.4.200.0230.03716.84
7.4.190.0230.03616.84
7.4.180.0410.01917.02
7.4.160.0350.04116.75
7.4.150.0350.02316.96
7.4.140.0360.03416.48
7.4.130.0400.03016.81
7.4.120.0530.02816.69
7.4.110.0430.02016.77
7.4.100.0380.02616.79
7.4.90.0390.02016.75
7.4.80.0500.01516.59
7.4.70.0310.02616.58
7.4.60.0350.02616.89
7.4.50.0310.03816.77
7.4.40.0420.03416.62
7.4.30.0380.03516.69
7.4.20.0380.03216.61
7.4.10.0400.02416.76
7.4.00.0520.03916.51
7.3.330.0140.00616.71
7.3.320.0040.00713.58
7.3.310.0090.00316.59
7.3.300.0080.00416.55
7.3.290.0290.03516.55
7.3.280.0300.02116.45
7.3.270.0410.02516.64
7.3.260.0370.03016.62
7.3.250.0640.02116.51
7.3.240.0310.02716.62
7.3.230.0340.01916.64
7.3.220.0400.01916.56
7.3.210.0410.03116.59
7.3.200.0350.02316.55
7.3.190.0500.01816.60
7.3.180.0430.02516.54
7.3.170.0460.01016.60
7.3.160.0410.03516.52
7.3.150.0320.03516.46
7.3.140.0380.02616.61
7.3.130.0280.02916.44
7.3.120.0300.02316.54
7.3.110.0300.02816.48
7.3.100.0520.02116.48
7.3.90.0430.01616.82
7.3.80.0320.02216.55
7.3.70.0340.01816.66
7.3.60.0320.02516.64
7.3.50.0390.02816.61
7.3.40.0230.02916.54
7.3.30.0280.02716.64
7.3.20.0480.01516.59
7.3.10.0560.02416.63
7.3.00.0250.03516.56

preferences:
79.05 ms | 400 KiB | 5 Q