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.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.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.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:
19.76 ms | 411 KiB | 12 Q