3v4l.org

run code in 300+ PHP versions simultaneously
<?php function daysInWeek($weekNum) { $result = array(); $datetime = new DateTime('00:00:00'); $datetime->setISODate((int)$datetime->format('o'), $weekNum, 1); $interval = new DateInterval('P7D'); $week = new DatePeriod($datetime, $interval, 52); foreach($week as $day){ $result[] = $day->format('D d m Y H:i:s'); } return $result; } //and the difficult ones:- var_dump(daysInWeek(1));

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.60.0120.00316.63
8.3.50.0060.01222.04
8.3.40.0150.00319.09
8.3.30.0110.00719.22
8.3.20.0000.00820.29
8.3.10.0040.00423.70
8.3.00.0030.00520.84
8.2.180.0060.01216.88
8.2.170.0120.00622.96
8.2.160.0070.00720.35
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0060.00318.93
8.2.110.0100.01022.11
8.2.100.0060.00619.23
8.2.90.0030.00617.75
8.2.80.0100.00017.97
8.2.70.0080.00017.93
8.2.60.0040.00417.93
8.2.50.0060.00318.10
8.2.40.0030.00522.32
8.2.30.0000.00820.04
8.2.20.0030.00519.78
8.2.10.0000.00818.32
8.2.00.0080.00017.86
8.1.280.0080.00825.92
8.1.270.0060.01323.79
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00321.02
8.1.230.0060.00619.10
8.1.220.0050.00317.77
8.1.210.0030.00618.77
8.1.200.0030.00617.36
8.1.190.0040.00417.36
8.1.180.0040.00718.10
8.1.170.0060.00318.77
8.1.160.0040.00422.00
8.1.150.0000.00818.86
8.1.140.0070.00317.64
8.1.130.0050.00217.91
8.1.120.0000.00717.55
8.1.110.0030.00617.66
8.1.100.0000.00717.66
8.1.90.0050.00217.68
8.1.80.0040.00417.64
8.1.70.0030.00517.62
8.1.60.0110.00017.80
8.1.50.0000.00817.52
8.1.40.0030.00617.58
8.1.30.0030.00717.78
8.1.20.0000.00817.79
8.1.10.0050.00317.65
8.1.00.0040.00417.71
8.0.300.0090.00019.77
8.0.290.0030.00516.88
8.0.280.0000.00818.48
8.0.270.0080.00417.34
8.0.260.0000.00817.25
8.0.250.0030.00317.13
8.0.240.0070.00017.15
8.0.230.0070.00017.16
8.0.220.0000.00716.95
8.0.210.0030.00616.98
8.0.200.0030.00317.15
8.0.190.0030.00617.16
8.0.180.0000.00817.16
8.0.170.0050.00317.02
8.0.160.0070.00016.99
8.0.150.0040.00416.94
8.0.140.0040.00416.95
8.0.130.0000.00713.48
8.0.120.0000.00817.06
8.0.110.0030.00517.09
8.0.100.0040.00417.16
8.0.90.0020.00517.16
8.0.80.0150.00017.12
8.0.70.0030.00517.07
8.0.60.0040.00417.00
8.0.50.0050.00317.21
8.0.30.0120.00817.15
8.0.20.0070.01317.40
8.0.10.0000.00817.24
8.0.00.0110.00916.96
7.4.330.0070.00015.00
7.4.320.0030.00316.72
7.4.300.0030.00616.74
7.4.290.0040.00416.67
7.4.280.0060.00316.68
7.4.270.0000.00716.74
7.4.260.0080.00016.75
7.4.250.0040.00416.61
7.4.240.0030.00416.73
7.4.230.0030.00316.68
7.4.220.0090.01016.71
7.4.210.0090.00916.70
7.4.200.0090.00016.68
7.4.190.0030.00316.61
7.4.160.0030.01416.85
7.4.150.0160.00417.40
7.4.140.0160.00917.86
7.4.130.0080.01016.66
7.4.120.0100.01116.74
7.4.110.0110.00716.54
7.4.100.0100.01016.70
7.4.90.0120.00816.66
7.4.80.0080.01319.39
7.4.70.0030.01416.73
7.4.60.0160.00616.49
7.4.50.0060.00316.76
7.4.40.0150.00316.55
7.4.30.0030.02216.71
7.4.00.0090.00615.10
7.3.330.0000.00613.45
7.3.320.0030.00313.38
7.3.310.0040.00416.48
7.3.300.0000.00716.45
7.3.290.0000.01416.37
7.3.280.0130.00816.45
7.3.270.0040.01517.40
7.3.260.0160.01416.63
7.3.250.0120.00716.57
7.3.240.0100.01016.65
7.3.230.0100.01016.63
7.3.210.0080.01216.71
7.3.200.0030.01319.39
7.3.190.0070.01216.66
7.3.180.0070.01016.47
7.3.170.0060.01216.64
7.3.160.0060.00916.72
7.3.120.0060.00915.01
7.2.330.0080.01416.68
7.2.320.0080.01116.66
7.2.310.0120.01216.78
7.2.300.0070.01116.69
7.2.290.0070.01016.70
7.2.60.0030.01017.21
7.2.00.0030.00919.60
7.1.200.0170.00316.00
7.1.100.0130.00418.50
7.1.70.0250.00317.43
7.1.60.0090.01519.46
7.1.50.0000.01917.04
7.1.00.0030.07722.39
7.0.200.0040.01416.74
7.0.140.0030.07322.10
7.0.60.0070.03719.96
7.0.50.0130.07017.88
7.0.40.0030.04720.18
7.0.30.0270.04720.09
7.0.20.0330.07320.09
7.0.10.0070.09020.13
7.0.00.0030.04720.07
5.6.280.0070.07320.87
5.6.210.0070.08020.50
5.6.200.0070.06018.23
5.6.190.0030.04320.55
5.6.180.0100.07020.46
5.6.170.0170.04320.48
5.6.160.0030.08020.51
5.6.150.0100.08318.16
5.6.140.0070.08718.29
5.6.130.0030.05318.19
5.6.120.0030.06021.00
5.6.110.0070.06021.15
5.6.100.0070.06321.05
5.6.90.0200.06320.98
5.6.80.0130.07720.41
5.5.350.0100.07320.43
5.5.340.0070.05017.98
5.5.330.0070.05720.44
5.5.320.0270.08320.36
5.5.310.0370.07720.21
5.5.300.0070.06017.95
5.5.290.0130.06317.98
5.5.280.0030.09320.85
5.5.270.0100.08020.87
5.5.260.0070.08320.76
5.5.250.0070.08320.66
5.5.240.0070.07320.19
5.4.450.3170.04019.28
5.4.440.3500.04019.32
5.4.430.3830.04019.41
5.4.420.3430.04319.63
5.4.410.3900.04319.08
5.4.400.3400.04319.26
5.4.390.3830.04319.16
5.4.380.3100.04019.00
5.4.370.4370.04019.16
5.4.360.3570.03019.24
5.4.350.3400.03719.08
5.4.340.3300.03019.32
5.4.320.3500.03719.01
5.4.310.3900.04018.95
5.4.300.3870.04019.15
5.4.290.3170.04319.19
5.4.280.2770.03718.95
5.4.270.3270.03319.00
5.4.260.3100.04318.95
5.4.250.2630.03319.09
5.4.240.3300.03319.33
5.4.230.3430.04019.16
5.4.220.2400.04019.31
5.4.210.3900.03719.05
5.4.200.3430.03019.23
5.4.190.3200.03719.14
5.4.180.3800.03719.14
5.4.170.3500.04018.98
5.4.160.3400.04019.07
5.4.150.3270.04019.20
5.4.140.3570.04716.36
5.4.130.3430.03716.68
5.4.120.3530.04016.50
5.4.110.3570.04016.45
5.4.100.3570.03716.55
5.4.90.3570.03316.28
5.4.80.3130.03316.49
5.4.70.4070.03316.57
5.4.60.3530.03716.25
5.4.50.3130.03316.25
5.4.40.3500.04016.43
5.4.30.3170.03016.25
5.4.20.3530.04016.43
5.4.10.3170.03316.53
5.4.00.3300.03715.96
5.3.290.3700.04014.75
5.3.280.2970.03714.68
5.3.270.3930.04014.84
5.3.260.3630.04014.66
5.3.250.3430.04014.63
5.3.240.3530.03714.54
5.3.230.3570.03314.65
5.3.220.3170.03714.49
5.3.210.3330.02714.50
5.3.200.3730.03314.66
5.3.190.3700.04014.47
5.3.180.2670.03314.54
5.3.170.3870.03714.48
5.3.160.3330.04314.59
5.3.150.3300.03014.68
5.3.140.3170.03714.79
5.3.130.3430.04014.63
5.3.120.3470.04014.54
5.3.110.3600.04014.47
5.3.100.3430.04014.04
5.3.90.3700.04314.04
5.3.80.3870.03313.91
5.3.70.3500.04314.10
5.3.60.3770.02713.92
5.3.50.3370.03713.87
5.3.40.4100.03313.89
5.3.30.3730.03713.84
5.3.20.3470.03013.79
5.3.10.3770.02713.69
5.3.00.3130.03713.56
5.2.170.3500.03711.15
5.2.160.3600.02711.15
5.2.150.3130.03711.09
5.2.140.3130.03011.07
5.2.130.2330.03011.22
5.2.120.2870.03011.15
5.2.110.2930.02711.18
5.2.100.2730.03711.03
5.2.90.3170.03311.02
5.2.80.3570.04011.00
5.2.70.3430.02711.10
5.2.60.3470.03011.13
5.2.50.2700.03010.96
5.2.40.2330.03311.16
5.2.30.2300.03310.88
5.2.20.2530.02710.96
5.2.10.2200.02710.84
5.2.00.2600.03010.80
5.1.60.2970.02010.00
5.1.50.2700.02710.00
5.1.40.2870.0279.95
5.1.30.3300.02310.30
5.1.20.2570.02010.25
5.1.10.2770.02310.00
5.1.00.2530.02310.15
5.0.50.1570.0178.95
5.0.40.1300.0208.95
5.0.30.1730.0278.95
5.0.20.1630.0208.95
5.0.10.1370.0238.95
5.0.00.1430.0338.95
4.4.90.1270.0178.95
4.4.80.1470.0178.95
4.4.70.1270.0208.95
4.4.60.1200.0178.95
4.4.50.1200.0178.95
4.4.40.1600.0278.95
4.4.30.0900.0278.95
4.4.20.1070.0178.95
4.4.10.1700.0178.95
4.4.00.1600.0238.95
4.3.110.1330.0138.95
4.3.100.1270.0178.95
4.3.90.1500.0138.95
4.3.80.1430.0278.95
4.3.70.1330.0178.95
4.3.60.1400.0208.95
4.3.50.1430.0138.95
4.3.40.1700.0238.95
4.3.30.0430.0208.95
4.3.20.0570.0208.95
4.3.10.0870.0208.95
4.3.00.0430.0208.95

preferences:
45.88 ms | 401 KiB | 5 Q