3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_weeks($month, $year) { $weeks = []; $ym = $year . '-' . $month; $final = date('t', strtotime($ym)); $firstSat = date('d', strtotime("first Saturday of $ym")); $d = 1; $weekNo = 0; do { $weekEnd = $d === 1 ? $firstSat : min($final, $d + 6); $weeks[] = sprintf( "Week %d: %s-%02d - %s-%02d", ++$weekNo, $ym, $d, $ym, $weekEnd ); $d = $weekEnd + 1; } while ($weekEnd < $final); return $weeks; } foreach (['01','02','03','04','05','06', '07', '08', '09', '10', '11', '12'] as $month) { echo var_export(get_weeks($month, '2020'), true) . "\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)
8.4.10.0060.00320.38
8.3.140.0110.00717.30
8.3.130.0000.00816.59
8.3.120.0140.00720.86
8.3.110.0100.00020.94
8.3.100.0060.00316.77
8.3.90.0050.00326.77
8.3.80.0060.00319.36
8.3.70.0060.01616.75
8.3.60.0070.00718.55
8.3.50.0050.01224.55
8.3.40.0160.00018.88
8.3.30.0070.00718.90
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.260.0070.01116.90
8.2.250.0090.00618.68
8.2.240.0070.00419.03
8.2.230.0120.00422.58
8.2.220.0070.01024.06
8.2.210.0030.00526.77
8.2.200.0060.00318.88
8.2.190.0090.00916.63
8.2.180.0120.00425.92
8.2.170.0120.00319.34
8.2.160.0110.00422.96
8.2.150.0060.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00019.61
8.2.110.0000.01022.24
8.2.100.0060.00619.70
8.2.90.0040.00419.47
8.2.80.0040.00419.89
8.2.70.0040.00417.88
8.2.60.0060.00318.00
8.2.50.0030.00518.05
8.2.40.0000.00818.47
8.2.30.0080.00018.24
8.2.20.0040.00418.14
8.2.10.0020.00519.46
8.2.00.0040.00419.36
8.1.310.0140.00418.19
8.1.300.0050.00318.51
8.1.290.0030.00630.84
8.1.280.0120.00625.92
8.1.270.0060.00323.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00024.04
8.1.230.0080.00319.30
8.1.220.0000.00817.91
8.1.210.0030.00518.77
8.1.200.0000.00817.60
8.1.190.0030.00517.50
8.1.180.0000.00918.10
8.1.170.0000.00918.83
8.1.160.0040.00419.04
8.1.150.0040.00418.99
8.1.140.0100.00019.02
8.1.130.0000.00720.13
8.1.120.0050.00317.76
8.1.110.0030.00617.77
8.1.100.0000.00817.73
8.1.90.0000.00717.71
8.1.80.0050.00317.71
8.1.70.0000.00717.63
8.1.60.0060.00317.76
8.1.50.0040.00417.70
8.1.40.0030.00517.75
8.1.30.0030.00517.83
8.1.20.0000.00817.69
8.1.10.0080.00017.59
8.1.00.0050.00317.76
8.0.300.0000.00818.77
8.0.290.0000.00817.00
8.0.280.0000.00720.19
8.0.270.0000.00818.35
8.0.260.0030.00320.26
8.0.250.0060.00317.25
8.0.240.0070.00017.21
8.0.230.0050.00217.30
8.0.220.0000.00717.07
8.0.210.0070.00017.21
8.0.200.0030.00317.27
8.0.190.0000.00717.29
8.0.180.0030.00617.21
8.0.170.0030.00617.14
8.0.160.0030.00517.20
8.0.150.0070.00017.23
8.0.140.0040.00417.21
8.0.130.0000.00613.58
8.0.120.0070.00017.07
8.0.110.0000.00817.28
8.0.100.0000.00717.09
8.0.90.0040.00417.09
8.0.80.0060.00817.17
8.0.70.0060.00317.29
8.0.60.0040.00417.05
8.0.50.0000.00717.20
8.0.30.0070.01017.48
8.0.20.0110.00917.47
8.0.10.0020.00517.29
8.0.00.0160.00317.01
7.4.330.0000.00515.55
7.4.320.0000.00616.63
7.4.300.0050.00516.57
7.4.290.0080.00016.71
7.4.280.0040.00416.57
7.4.270.0050.00316.71
7.4.260.0030.00313.32
7.4.250.0030.00316.76
7.4.240.0000.00716.84
7.4.230.0070.00016.46
7.4.220.0040.00416.60
7.4.210.0070.00716.75
7.4.200.0000.00716.71
7.4.130.0090.01516.75
7.4.120.0150.00516.78
7.4.110.0100.00716.69
7.4.100.0100.00716.88
7.4.90.0140.00616.61
7.4.80.0140.00516.48
7.4.70.0130.00616.75
7.4.60.0080.00916.53
7.4.50.0080.01016.80
7.4.40.0110.00716.64
7.4.30.0190.00016.74
7.4.20.0060.01216.73
7.4.10.0060.01316.90
7.4.00.0100.01016.73
7.3.330.0000.00716.35
7.3.320.0000.00513.50
7.3.310.0050.00316.46
7.3.300.0050.00216.43
7.3.290.0070.00916.53
7.3.280.0120.00316.57
7.3.260.0060.01216.81
7.3.230.0050.01116.86
7.3.210.0060.01216.68
7.3.200.0070.01116.69
7.3.190.0070.01016.72
7.3.180.0060.01016.65
7.3.170.0060.01216.80
7.3.160.0050.01116.79
7.3.150.0130.00416.63
7.3.140.0170.00016.59
7.3.130.0070.01116.63
7.3.120.0080.00816.77
7.3.110.0090.00916.53
7.3.100.0130.00516.61
7.3.90.0120.01216.59
7.3.80.0140.00316.65
7.3.70.0160.00616.71
7.3.60.0070.01016.75
7.3.50.0170.00616.67
7.3.40.0120.01216.54
7.3.30.0070.01016.85
7.3.20.0130.00816.64
7.3.10.0070.01016.64
7.3.00.0140.00316.61
7.2.330.0140.00416.98
7.2.320.0120.00916.93
7.2.310.0090.00916.87
7.2.300.0130.00616.92
7.2.290.0090.01217.08
7.2.280.0060.01316.84
7.2.270.0090.01217.00
7.2.260.0090.01316.70
7.2.250.0090.00917.09
7.2.240.0090.00916.96
7.2.230.0140.00617.02
7.2.220.0070.01116.95
7.2.210.0180.00616.87
7.2.200.0140.01116.80
7.2.190.0130.00916.83
7.2.180.0100.01516.94
7.2.170.0150.01016.86
7.2.160.0150.00316.96
7.2.150.0130.00716.93
7.2.140.0140.00716.95
7.2.130.0040.01716.84
7.2.120.0120.00816.90
7.2.110.0130.00816.90
7.2.100.0100.01016.89
7.2.90.0090.00916.95
7.2.80.0120.00817.08
7.2.70.0140.00617.04
7.2.60.0220.01616.94
7.2.50.0110.01717.06
7.2.40.0130.01316.95
7.2.30.0150.00317.06
7.2.20.0140.00416.92
7.2.10.0080.01017.00
7.2.00.0110.01116.95

preferences:
28.28 ms | 403 KiB | 5 Q