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('P1D'); $week = new DatePeriod($datetime, $interval, 6); foreach($week as $day){ $result[] = $day->format('D d m Y H:i:s'); } return $result; } var_dump(daysInWeek(24)); //and the difficult ones:- var_dump(daysInWeek(1)); var_dump(daysInWeek(53));

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.130.0080.00316.84
8.3.120.0060.00319.04
8.3.110.0030.00516.63
8.3.100.0100.00724.06
8.3.90.0000.00818.38
8.3.80.0030.00918.55
8.3.70.0070.01016.61
8.3.60.0120.00616.75
8.3.50.0070.00822.17
8.3.40.0090.00618.76
8.3.30.0120.00319.16
8.3.20.0050.00320.33
8.3.10.0030.00523.61
8.3.00.0040.00419.79
8.2.250.0030.00617.11
8.2.240.0030.00617.48
8.2.230.0000.00820.94
8.2.220.0050.00537.54
8.2.210.0060.00926.77
8.2.200.0000.01016.75
8.2.190.0170.00318.29
8.2.180.0150.00316.63
8.2.170.0120.00318.93
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00420.78
8.2.110.0060.00322.08
8.2.100.0080.00417.97
8.2.90.0040.00418.16
8.2.80.0080.00019.23
8.2.70.0050.00318.16
8.2.60.0040.00418.28
8.2.50.0050.00518.07
8.2.40.0080.00018.16
8.2.30.0030.00718.50
8.2.20.0050.00217.83
8.2.10.0000.00718.13
8.2.00.0020.00518.06
8.1.300.0030.00618.70
8.1.290.0080.00618.88
8.1.280.0120.00325.92
8.1.270.0030.00623.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0040.00422.14
8.1.230.0110.00020.85
8.1.220.0030.00517.78
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0030.00517.48
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0050.00222.09
8.1.150.0040.00418.87
8.1.140.0000.00817.67
8.1.130.0030.00317.90
8.1.120.0050.00217.66
8.1.110.0000.00717.55
8.1.100.0070.00017.71
8.1.90.0040.00417.71
8.1.80.0040.00417.71
8.1.70.0030.00317.60
8.1.60.0000.00917.76
8.1.50.0040.00417.63
8.1.40.0050.00317.55
8.1.30.0030.00617.79
8.1.20.0080.00017.67
8.1.10.0000.00817.75
8.1.00.0040.00417.64
8.0.300.0000.00820.13
8.0.290.0050.00316.88
8.0.280.0000.00718.52
8.0.270.0000.00717.02
8.0.260.0000.00617.36
8.0.250.0030.00317.16
8.0.240.0000.00717.15
8.0.230.0030.00617.07
8.0.220.0060.00316.99
8.0.210.0000.00917.11
8.0.200.0000.00717.18
8.0.190.0040.00417.07
8.0.180.0000.00917.14
8.0.170.0040.00417.02
8.0.160.0040.00416.95
8.0.150.0020.00517.10
8.0.140.0040.00417.03
8.0.130.0000.00513.46
8.0.120.0000.00816.93
8.0.110.0000.00717.01
8.0.100.0040.00417.09
8.0.90.0040.00417.12
8.0.80.0060.00917.12
8.0.70.0040.00417.04
8.0.60.0000.00717.13
8.0.50.0000.00816.93
8.0.30.0120.00917.28
8.0.20.0120.00917.30
8.0.10.0170.00617.13
8.0.00.0120.00817.08
7.4.330.0050.00015.17
7.4.320.0000.00616.67
7.4.300.0030.00316.75
7.4.290.0030.00316.61
7.4.280.0070.00016.65
7.4.270.0040.00416.61
7.4.260.0030.00516.64
7.4.250.0030.00516.60
7.4.240.0030.00516.63
7.4.230.0040.00416.83
7.4.220.0130.00616.61
7.4.210.0060.01016.77
7.4.200.0040.00416.55
7.4.160.0070.01116.76
7.4.150.0110.00816.83
7.4.140.0120.01417.20
7.4.130.0090.01216.69
7.4.120.0090.01116.62
7.4.110.0170.00516.60
7.4.100.0110.01016.64
7.4.90.0120.01016.63
7.4.80.0110.01117.20
7.4.70.0130.00716.57
7.4.60.0140.00816.68
7.4.50.0130.01016.61
7.4.40.0130.00816.66
7.4.30.0100.01216.62
7.4.20.0100.01216.60
7.4.10.0120.00916.67
7.4.00.0100.01016.43
7.3.330.0060.00013.30
7.3.320.0030.00313.45
7.3.310.0070.00016.55
7.3.300.0070.00016.50
7.3.290.0070.01016.47
7.3.280.0080.00716.44
7.3.270.0110.00916.92
7.3.260.0080.01116.53
7.3.250.0130.01016.77
7.3.240.0130.00916.67
7.3.230.0140.00616.59
7.3.220.0140.00816.57
7.3.210.0170.00616.58
7.3.200.0090.00917.06
7.3.190.0120.00916.61
7.3.180.0090.01216.54
7.3.170.0130.00716.60
7.3.160.0100.01216.60
7.3.150.0090.01216.61
7.3.140.0090.01116.54
7.3.130.0110.00916.58
7.3.120.0130.00916.39
7.3.110.0130.00816.66
7.3.100.0100.01116.54
7.3.90.0110.00816.54
7.3.80.0110.01016.57
7.3.70.0120.00916.55
7.3.60.0090.01016.09
7.3.50.0120.00716.09
7.3.40.0150.00716.03
7.3.30.0110.01016.01
7.3.20.0100.01116.35
7.3.10.0490.00916.36
7.3.00.0130.00816.43
7.2.340.0120.01116.88
7.2.330.0150.01116.80
7.2.320.0130.01116.94
7.2.310.0160.01016.80
7.2.300.0140.00916.86
7.2.290.0180.00616.92
7.2.280.0120.01216.92
7.2.270.0160.00816.83
7.2.260.0170.00816.77
7.2.250.0130.01216.88
7.2.240.0130.00916.79
7.2.230.0180.00816.85
7.2.220.0170.00516.74
7.2.210.0120.01016.74
7.2.200.0090.01516.80
7.2.190.0130.00916.28
7.2.180.0130.01016.37
7.2.170.0140.00916.24
7.2.160.0130.01116.26
7.2.150.0130.00916.61
7.2.140.0160.01016.59
7.2.130.0120.01016.63
7.2.120.0150.00716.64
7.2.110.0140.00816.70
7.2.100.0200.00716.66
7.2.90.0130.01016.71
7.2.80.0120.01016.73
7.2.70.0140.00916.56
7.2.60.0140.00916.57
7.2.50.0150.00816.58
7.2.40.0190.00716.52
7.2.30.0160.00816.55
7.2.20.0170.01016.61
7.2.10.0170.00816.51
7.2.00.0130.01016.83
7.1.330.0320.01015.76
7.1.320.0270.00515.70
7.1.310.0240.00915.71
7.1.300.0180.01015.44
7.1.290.0190.01115.50
7.1.280.0170.00915.50
7.1.270.0150.01015.46
7.1.260.0180.00915.41
7.1.250.0260.00815.49
7.1.240.0310.00815.53
7.1.230.0180.00815.44
7.1.220.0170.01015.41
7.1.210.0170.00915.40
7.1.200.0170.00615.51
7.1.190.0180.01115.42
7.1.180.0580.00915.44
7.1.170.0240.01015.26
7.1.160.0190.01315.25
7.1.150.0190.00715.31
7.1.140.0230.01215.27
7.1.130.0180.01015.20
7.1.120.0210.00715.26
7.1.110.0200.00815.33
7.1.100.0170.01115.66
7.1.90.0220.00815.60
7.1.80.0180.00915.55
7.1.70.0150.00815.61
7.1.60.0180.01019.28
7.1.50.0200.00919.23
7.1.40.0160.01219.17
7.1.30.0190.01019.19
7.1.20.0210.00819.13
7.1.10.0170.00915.64
7.1.00.0170.00815.61
7.0.330.0190.00915.18
7.0.320.0170.00915.22
7.0.310.0200.00815.10
7.0.300.0160.01215.01
7.0.290.0190.01115.00
7.0.280.0170.00915.13
7.0.270.0240.00914.97
7.0.260.0220.00914.98
7.0.250.0190.00815.00
7.0.240.0190.00815.05
7.0.230.0180.00815.08
7.0.220.0180.00715.00
7.0.210.0190.00715.05
7.0.200.0190.00715.39
7.0.190.0150.00815.42
7.0.180.0240.00615.26
7.0.170.0180.00815.34
7.0.160.0150.00815.30
7.0.150.0150.00815.26
7.0.140.0200.00915.30
7.0.130.0160.00615.35
7.0.120.0150.00915.30
7.0.110.0200.00815.22
7.0.100.0150.00915.23
7.0.90.0180.00615.25
7.0.80.0160.00815.26
7.0.70.0160.00815.28
7.0.60.0180.00815.20
7.0.50.0150.00915.24
7.0.40.0170.00815.23
7.0.30.0140.01015.19
7.0.20.0160.00815.17
7.0.10.0200.00715.26
7.0.00.0180.00815.20
5.6.400.0160.01415.60
5.6.390.0180.01115.75
5.6.380.0190.00915.54
5.6.370.0190.01015.77
5.6.360.0190.01115.76
5.6.350.0150.01315.70
5.6.340.0150.01315.66
5.6.330.0190.00815.70
5.6.320.0140.01315.75
5.6.310.0180.00815.70
5.6.300.0150.01716.62
5.6.290.0160.01816.63
5.6.280.0140.01816.62
5.6.270.0170.01516.67
5.6.260.0140.01816.64
5.6.250.0140.02016.67
5.6.240.0170.01916.58
5.6.230.0150.02116.63
5.6.220.0190.01716.61
5.6.210.0130.02016.60
5.6.200.0190.01616.58
5.6.190.0150.02116.61
5.6.180.0140.01816.61
5.6.170.0150.01716.60
5.6.160.0140.01816.57
5.6.150.0140.01916.63
5.6.140.0130.02316.63
5.6.130.0150.01816.66
5.6.120.0140.02216.62
5.6.110.0170.01716.69
5.6.100.0130.02016.62
5.6.90.0150.01816.59
5.6.80.0140.01816.46
5.6.70.0160.01716.41
5.6.60.0140.01916.45
5.6.50.0140.01916.40
5.6.40.0140.01716.40
5.6.30.0150.01816.45
5.6.20.0140.02116.47
5.6.10.0140.01716.49
5.6.00.0140.01816.37
5.5.380.0170.01815.62
5.5.370.0150.01715.65
5.5.360.0150.01915.59
5.5.350.0160.01815.61
5.5.340.0160.01915.70
5.5.330.0160.01815.72
5.5.320.0120.02015.76
5.5.310.0170.01715.70
5.5.300.0150.01815.70
5.5.290.0150.02115.72
5.5.280.0170.01815.75
5.5.270.0150.01715.69
5.5.260.0140.01915.75
5.5.250.0180.01615.73
5.5.240.0150.01915.50
5.5.230.0150.01815.56
5.5.220.0160.01915.52
5.5.210.0140.01915.52
5.5.200.0140.01815.57
5.5.190.0140.01715.50
5.5.180.0140.01915.52
5.5.170.0160.01315.67
5.5.160.0150.01915.48
5.5.150.0170.01915.55
5.5.140.0180.01415.48
5.5.130.0150.01815.51
5.5.120.0110.02215.57
5.5.110.0140.02015.54
5.5.100.0140.01815.59
5.5.90.0140.01915.50
5.5.80.0140.02015.56
5.5.70.0140.01815.55
5.5.60.0160.01715.57
5.5.50.0130.01815.48
5.5.40.0130.01915.44
5.5.30.0160.01615.57
5.5.20.0150.01815.46
5.5.10.0170.01715.45
5.5.00.0160.02215.46
5.4.450.0150.01614.06
5.4.440.0110.01713.98
5.4.430.0120.01513.95
5.4.420.0140.01413.97
5.4.410.0130.01513.99
5.4.400.0090.01813.85
5.4.390.0130.01613.87
5.4.380.0120.01613.87
5.4.370.0140.01513.91
5.4.360.0130.01513.82
5.4.350.0130.01513.92
5.4.340.0110.01613.90
5.4.330.0180.00612.75
5.4.320.0130.01513.84
5.4.310.0120.01913.91
5.4.300.0110.01713.90
5.4.290.0120.01613.94
5.4.280.0130.01613.86
5.4.270.0120.01613.92
5.4.260.0130.01713.84
5.4.250.0110.01613.86
5.4.240.0120.01813.88
5.4.230.0120.01513.87
5.4.220.0120.01813.88
5.4.210.0130.01713.84
5.4.200.0120.01713.88
5.4.190.0130.01513.84
5.4.180.0130.01713.86
5.4.170.0130.01613.87
5.4.160.0140.01513.84
5.4.150.0110.01613.86
5.4.140.0110.01613.46
5.4.130.0120.01413.41
5.4.120.0130.01513.46
5.4.110.0130.01413.42
5.4.100.0140.01613.38
5.4.90.0140.01513.44
5.4.80.0110.01513.40
5.4.70.0100.01713.40
5.4.60.0120.01613.46
5.4.50.0130.01413.40
5.4.40.0140.01213.38
5.4.30.0120.01313.41
5.4.20.0080.01913.41
5.4.10.0110.01713.39
5.4.00.0130.01413.30
5.3.290.0140.01413.22
5.3.280.0110.01713.14
5.3.270.0150.01813.19
5.3.260.0140.01613.18
5.3.250.0110.01913.12
5.3.240.0130.01813.10
5.3.230.0120.01513.14
5.3.220.0150.01613.07
5.3.210.0130.01613.05
5.3.200.0090.01713.06
5.3.190.0130.01613.08
5.3.180.0110.01613.20
5.3.170.0130.01413.14
5.3.160.0120.01613.16
5.3.150.0150.01313.12
5.3.140.0110.01713.13
5.3.130.0110.01613.13
5.3.120.0100.01613.08
5.3.110.0120.01613.11
5.3.100.0100.01713.05
5.3.90.0110.01513.08
5.3.80.0110.01513.02
5.3.70.0110.01413.02
5.3.60.0170.01113.08
5.3.50.0100.01613.09
5.3.40.0100.01513.09
5.3.30.0110.01613.06
5.3.20.0110.01513.02
5.3.10.0110.01612.88
5.3.00.0120.01412.89
5.2.170.0150.00512.72
5.2.160.0170.00212.69
5.2.150.0100.00912.68
5.2.140.0170.00412.72
5.2.130.0120.00712.70
5.2.120.0110.00812.64
5.2.110.0080.01312.55
5.2.100.0120.00712.68
5.2.90.0130.00612.58
5.2.80.0130.00712.55
5.2.70.0110.00912.54
5.2.60.0120.00812.63
5.2.50.0120.00712.70
5.2.40.0130.00412.54
5.2.30.0110.00812.60
5.2.20.0100.00812.46
5.2.10.0130.00712.45
5.2.00.0130.00612.37
5.1.60.0110.00711.88
5.1.50.0120.00511.92
5.1.40.0090.00712.00
5.1.30.0050.01212.00
5.1.20.0100.00612.04
5.1.10.0090.00711.99
5.1.00.0110.00712.01
5.0.50.0130.00311.46
5.0.40.0110.00311.50
5.0.30.0090.00711.43
5.0.20.0090.00711.39
5.0.10.0070.00911.31
5.0.00.0110.00511.31
4.4.90.0100.00211.12
4.4.80.0050.00411.12
4.4.70.0070.00211.12
4.4.60.0060.00311.12
4.4.50.0050.00411.12
4.4.40.0070.00311.12
4.4.30.0070.00211.12
4.4.20.0070.00211.12
4.4.10.0090.00111.12
4.4.00.0070.00211.12
4.3.110.0060.00411.12
4.3.100.0070.00311.12
4.3.90.0040.00611.12
4.3.80.0090.00211.12
4.3.70.0060.00411.12
4.3.60.0080.00311.12
4.3.50.0070.00411.12
4.3.40.0040.00511.12
4.3.30.0040.00511.12
4.3.20.0040.00411.12
4.3.10.0050.00311.12
4.3.00.0030.00611.12

preferences:
31.64 ms | 403 KiB | 5 Q