3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Input date format: YYYY-mm-dd function getMonthWeekNumbers( $first_date ) { $last_date = date( "Y-m-t",strtotime( $first_date ) ); $first_week = date( "W",strtotime( $first_date ) ); $last_week = date( "W",strtotime( $last_date ) ); // If last day of month have on first week on next year, subtract a week from the date if( $last_week == '01' ) { $last_week = date( "W",( strtotime( $last_date )-604800 ) ); } for( $i=$first_week; $i <= $last_week; $i++ ) { echo "Week #".$i.", "; } } getMonthWeekNumbers( '2019-12-01' );

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.120.0040.00520.65
8.4.110.0070.01322.28
8.4.100.0120.00822.49
8.4.90.0130.00718.50
8.4.80.0110.00918.04
8.4.70.0050.00418.05
8.4.60.0120.00919.05
8.4.50.0040.00420.24
8.4.40.0130.00719.80
8.4.30.0040.00422.60
8.4.20.0040.01120.89
8.4.10.0030.01322.55
8.3.250.0110.00818.88
8.3.240.0120.00816.57
8.3.230.0080.00216.71
8.3.220.0030.00617.11
8.3.210.0050.00316.59
8.3.200.0060.00316.66
8.3.190.0090.00917.25
8.3.180.0070.00316.75
8.3.170.0100.00619.02
8.3.160.0000.00820.11
8.3.150.0130.00316.78
8.3.140.0040.01118.91
8.3.130.0170.00318.40
8.3.120.0030.00519.14
8.3.110.0030.00618.43
8.3.100.0050.00320.27
8.3.90.0000.00816.63
8.3.80.0040.00418.68
8.3.70.0120.00918.80
8.3.60.0100.00318.55
8.3.50.0080.00617.58
8.3.40.0090.00618.70
8.3.30.0120.00319.02
8.3.20.0080.00022.65
8.3.10.0030.00523.65
8.3.00.0080.00022.54
8.2.290.0060.00420.52
8.2.280.0120.00818.54
8.2.270.0110.00718.91
8.2.260.0150.00416.68
8.2.250.0130.00716.71
8.2.240.0040.01117.27
8.2.230.0050.00320.94
8.2.220.0060.00324.06
8.2.210.0110.00426.77
8.2.200.0060.00316.75
8.2.190.0100.01016.88
8.2.180.0100.01018.24
8.2.170.0100.00622.96
8.2.160.0120.00320.44
8.2.150.0030.00625.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0040.00422.25
8.2.100.0090.00317.91
8.2.90.0050.00318.03
8.2.80.0000.00817.88
8.2.70.0000.00817.63
8.2.60.0000.00817.79
8.2.50.0000.00918.07
8.2.40.0040.00418.29
8.2.30.0040.00418.28
8.2.20.0040.00418.29
8.2.10.0000.00819.27
8.2.00.0070.00019.29
8.1.330.0100.00922.22
8.1.320.0110.00816.16
8.1.310.0100.00718.45
8.1.300.0100.01017.74
8.1.290.0060.00318.88
8.1.280.0110.00425.92
8.1.270.0080.00020.57
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.00322.53
8.1.230.0040.00820.92
8.1.220.0050.00317.78
8.1.210.0030.00618.88
8.1.200.0050.00517.47
8.1.190.0060.00317.48
8.1.180.0000.00818.10
8.1.170.0030.00618.83
8.1.160.0020.00518.91
8.1.150.0070.00319.09
8.1.140.0030.00720.87
8.1.130.0030.00320.11
8.1.120.0030.00317.68
8.1.110.0000.00817.66
8.1.100.0050.00417.56
8.1.90.0000.00717.70
8.1.80.0040.00417.76
8.1.70.0070.00017.59
8.1.60.0000.00817.79
8.1.50.0030.00517.70
8.1.40.0040.00417.71
8.1.30.0060.00317.85
8.1.20.0100.00317.79
8.1.10.0040.00417.73
8.1.00.0040.00417.65
8.0.300.0080.00020.15
8.0.290.0080.00016.88
8.0.280.0000.00718.56
8.0.270.0030.00317.16
8.0.260.0030.00320.00
8.0.250.0000.00817.18
8.0.240.0030.00317.15
8.0.230.0070.00017.10
8.0.220.0000.00717.12
8.0.210.0040.00416.99
8.0.200.0000.00617.05
8.0.190.0000.00717.14
8.0.180.0040.00417.16
8.0.170.0050.00317.02
8.0.160.0080.00017.12
8.0.150.0050.00217.09
8.0.140.0100.00017.09
8.0.130.0030.00313.45
8.0.120.0050.00317.18
8.0.110.0040.00416.92
8.0.100.0040.00417.18
8.0.90.0000.00916.95
8.0.80.0040.01317.18
8.0.70.0050.00216.98
8.0.60.0000.00717.01
8.0.50.0000.00716.99
8.0.30.0110.00817.24
8.0.20.0210.01117.23
8.0.10.0120.01717.32
8.0.00.0140.01417.24
7.4.330.0030.00315.55
7.4.320.0030.00316.67
7.4.300.0060.00016.77
7.4.290.0070.00016.59
7.4.280.0050.00316.79
7.4.270.0070.00016.77
7.4.260.0030.00313.38
7.4.250.0040.00416.73
7.4.240.0000.00716.76
7.4.230.0030.00316.87
7.4.220.0020.00516.59
7.4.210.0070.00816.76
7.4.200.0030.00316.86
7.4.160.0290.00416.82
7.4.150.0230.01116.77
7.4.140.0170.00817.08
7.4.130.0140.00916.71
7.4.120.0170.00616.61
7.4.110.0140.01316.66
7.4.100.0150.01116.61
7.4.90.0180.01416.65
7.4.80.0100.01017.59
7.4.70.0140.00816.64
7.4.60.0140.00916.71
7.4.50.0120.01016.65
7.4.40.0130.01216.56
7.4.30.0150.00916.75
7.4.20.0120.00816.54
7.4.10.0140.00616.64
7.4.00.0130.00716.42
7.3.330.0000.00716.56
7.3.320.0030.00313.46
7.3.310.0030.00316.39
7.3.300.0000.00716.47
7.3.290.0070.00016.45
7.3.280.0110.00816.52
7.3.270.0140.01716.52
7.3.260.0140.00816.65
7.3.250.0220.00816.63
7.3.240.0120.01016.67
7.3.230.0160.01016.60
7.3.220.0180.01216.70
7.3.210.0140.00916.63
7.3.200.0140.00816.63
7.3.190.0180.00516.59
7.3.180.0140.00716.65
7.3.170.0170.00816.61
7.3.160.0170.00916.49
7.3.150.0130.01016.58
7.3.140.0180.00816.58
7.3.130.0130.00816.61
7.3.120.0140.00816.57
7.3.110.0120.01116.47
7.3.100.0100.01116.34
7.3.90.0110.01016.41
7.3.80.0140.00716.26
7.3.70.0100.01216.25
7.3.60.0100.00916.25
7.3.50.0110.01016.32
7.3.40.0130.01016.36
7.3.30.0160.00716.22
7.3.20.0150.01216.34
7.3.10.0120.01316.28
7.3.00.0180.01016.29
7.2.340.0250.01416.77
7.2.330.0180.01016.72
7.2.320.0200.00916.70
7.2.310.0180.01116.74
7.2.300.0210.00816.74
7.2.290.0210.01016.67
7.2.280.0220.01216.84
7.2.270.0190.01216.87
7.2.260.0170.00816.76
7.2.250.0160.01116.74
7.2.240.0140.01116.73
7.2.230.0160.00716.45
7.2.220.0160.00816.54
7.2.210.0130.01016.34
7.2.200.0150.01016.49
7.2.190.0160.00816.47
7.2.180.0150.01116.46
7.2.170.0150.01016.49
7.2.160.0160.01116.46
7.2.150.0170.01016.54
7.2.140.0200.01016.43
7.2.130.0170.00916.60
7.2.120.0140.01216.52
7.2.110.0160.00916.48
7.2.100.0160.00916.54
7.2.90.0170.00916.51
7.2.80.0170.01116.44
7.2.70.0170.01016.51
7.2.60.0150.01016.48
7.2.50.0140.01216.48
7.2.40.0380.00916.53
7.2.30.0160.01016.56
7.2.20.0110.01216.47
7.2.10.0170.01216.54
7.2.00.0170.00716.55
7.1.330.0140.00915.87
7.1.320.0150.00615.49
7.1.310.0150.01015.51
7.1.300.0140.00915.43
7.1.290.0150.01015.47
7.1.280.0150.01015.54
7.1.270.0150.01415.52
7.1.260.0150.00915.46
7.1.250.0520.00715.44
7.1.240.0140.00815.70
7.1.230.0150.01215.76
7.1.220.0130.01215.70
7.1.210.0110.01215.76
7.1.200.0160.01015.73
7.1.190.0190.00515.75
7.1.180.0240.00815.65
7.1.170.0140.01215.67
7.1.160.0180.00815.68
7.1.150.0150.00815.72
7.1.140.0190.00915.71
7.1.130.0120.00915.66
7.1.120.0170.00615.67
7.1.110.0170.00715.71
7.1.100.0220.01115.69
7.1.90.0170.00715.76
7.1.80.0150.00915.70
7.1.70.0180.00815.62
7.1.60.0130.00915.78
7.1.50.0130.01015.69
7.1.40.0170.00915.73
7.1.30.0150.01015.78
7.1.20.0190.00815.74
7.1.10.0170.00915.79
7.1.00.0390.00815.61
7.0.330.0150.01415.35
7.0.320.0170.00915.43
7.0.310.0200.00915.36
7.0.300.0150.01315.41
7.0.290.0330.01015.44
7.0.280.0210.00815.38
7.0.270.0160.00915.39
7.0.260.0190.00815.43
7.0.250.0180.01215.46
7.0.240.0220.00715.47
7.0.230.0220.00715.55
7.0.220.0410.00915.52
7.0.210.0190.00915.50
7.0.200.0220.00915.52
7.0.190.0210.00715.48
7.0.180.0150.01115.37
7.0.170.0210.00915.47
7.0.160.0250.00615.47
7.0.150.0180.00915.54
7.0.140.0220.00615.43
7.0.130.0170.01015.45
7.0.120.0160.00915.45
7.0.110.0170.01215.46
7.0.100.0200.01015.46
7.0.90.0170.01015.46
7.0.80.0200.00815.41
7.0.70.0210.00815.42
7.0.60.0260.00715.50
7.0.50.0170.01015.41
7.0.40.0180.01215.50
7.0.30.0260.00515.43
7.0.20.0190.01215.41
7.0.10.0200.01015.39
7.0.00.0200.00815.41
5.6.400.0190.01116.13
5.6.390.0220.01116.08
5.6.380.0180.01216.13
5.6.370.0170.01316.15
5.6.360.0150.01416.13
5.6.350.0210.01216.14
5.6.340.0200.00816.20
5.6.330.0150.01215.99
5.6.320.0180.01116.09
5.6.310.0220.00915.94
5.6.300.0210.00916.05
5.6.290.0180.01116.19
5.6.280.0180.01116.07
5.6.270.0220.00816.21
5.6.260.0150.01416.05
5.6.250.0180.01316.06
5.6.240.0220.00716.06
5.6.230.0200.01016.17
5.6.220.0190.01216.14
5.6.210.0220.00916.15
5.6.200.0210.00916.16
5.6.190.0210.01216.13
5.6.180.0160.01516.12
5.6.170.0190.01016.01
5.6.160.0160.01116.13
5.6.150.0210.01016.10
5.6.140.0210.01016.13
5.6.130.0160.01416.10
5.6.120.0200.01116.08
5.6.110.0170.01115.98
5.6.100.0190.01016.04
5.6.90.0190.00915.98
5.6.80.0190.01015.97
5.6.70.0220.01016.04
5.6.60.0190.01016.00
5.6.50.0190.01115.95
5.6.40.0150.01216.06
5.6.30.0240.00616.01
5.6.20.0180.01215.98
5.6.10.0150.01615.94
5.6.00.0210.00916.08
5.5.380.0190.01316.14
5.5.370.0200.01116.01
5.5.360.0180.01616.04
5.5.350.0180.01216.08
5.5.340.0200.01215.99
5.5.330.0210.00816.04
5.5.320.0140.01316.04
5.5.310.0130.01416.06
5.5.300.0170.01516.00
5.5.290.0160.01515.92
5.5.280.0200.01216.01
5.5.270.0180.01316.06
5.5.260.0170.01115.97
5.5.250.0150.01216.00
5.5.240.0210.01115.99
5.5.230.0220.01015.94
5.5.220.0140.01516.00
5.5.210.0190.01416.09
5.5.200.0190.01115.96
5.5.190.0190.01215.93
5.5.180.0190.00815.95
5.5.170.0170.01115.84
5.5.160.0100.01615.84
5.5.150.0220.00715.94
5.5.140.0180.01415.94
5.5.130.0220.00915.92
5.5.120.0240.00815.87
5.5.110.0180.01115.90
5.5.100.0190.01316.01
5.5.90.0230.00915.96
5.5.80.0130.01416.00
5.5.70.0140.01516.06
5.5.60.0180.01315.89
5.5.50.0150.01316.06
5.5.40.0190.01115.94
5.5.30.0210.01115.92
5.5.20.0230.00816.00
5.5.10.0170.01115.92
5.5.00.0130.01216.00
5.4.450.0120.01012.88
5.4.440.0130.00612.92
5.4.430.0170.00512.91
5.4.420.0150.00512.92
5.4.410.0160.00712.93
5.4.400.0140.00812.89
5.4.390.0150.00812.81
5.4.380.0090.00912.83
5.4.370.0160.00612.77
5.4.360.0130.00812.73
5.4.350.0180.00612.82
5.4.340.0170.00512.81
5.4.330.0150.00912.82
5.4.320.0150.00812.78
5.4.310.0200.00412.91
5.4.300.0150.00812.88
5.4.290.0160.00812.87
5.4.280.0190.00712.90
5.4.270.0180.00812.87
5.4.260.0130.00812.91
5.4.250.0210.00412.83
5.4.240.0140.01012.87
5.4.230.0120.00812.74
5.4.220.0110.01012.76
5.4.210.0160.00712.73
5.4.200.0130.00712.72
5.4.190.0150.00912.75
5.4.180.0170.00712.78
5.4.170.0130.00912.72
5.4.160.0140.00812.76
5.4.150.0120.00912.77
5.4.140.0130.00812.79
5.4.130.0130.00712.79
5.4.120.0100.00912.81
5.4.110.0150.00712.87
5.4.100.0140.00812.77
5.4.90.0160.00612.90
5.4.80.0150.00712.92
5.4.70.0160.00712.96
5.4.60.0170.00412.89
5.4.50.0190.00712.81
5.4.40.0180.00912.79
5.4.30.0180.00712.85
5.4.20.0150.00512.91
5.4.10.0160.00612.88
5.4.00.0100.01212.85
5.3.290.0140.01113.36
5.3.280.0120.01013.31
5.3.270.0130.00913.34
5.3.260.0120.01013.35
5.3.250.0170.00713.31
5.3.240.0170.00613.29
5.3.230.0150.00713.29
5.3.220.0140.00913.11
5.3.210.0140.00613.10
5.3.200.0140.00713.10
5.3.190.0160.00813.14
5.3.180.0110.01213.29
5.3.170.0130.00813.25
5.3.160.0160.00513.35
5.3.150.0140.00813.26
5.3.140.0150.00813.21
5.3.130.0150.00913.18
5.3.120.0140.00813.18
5.3.110.0170.00513.30
5.3.100.0120.00813.19
5.3.90.0160.00913.25
5.3.80.0170.00513.18
5.3.70.0150.00613.07
5.3.60.0170.00813.21
5.3.50.0100.01213.25
5.3.40.0120.00913.27
5.3.30.0120.01213.38
5.3.20.0110.00813.33
5.3.10.0120.00913.03
5.3.00.0140.00713.09
5.2.170.0150.00412.38
5.2.160.0120.00612.39
5.2.150.0120.00612.30
5.2.140.0070.01212.29
5.2.130.0120.00512.05
5.2.120.0120.00712.14
5.2.110.0130.00612.14
5.2.100.0110.00812.26
5.2.90.0080.01112.06
5.2.80.0100.00812.05
5.2.70.0150.00612.00
5.2.60.0110.00912.00
5.2.50.0080.01012.11
5.2.40.0090.01112.10
5.2.30.0130.00512.06
5.2.20.0140.00611.90
5.2.10.0100.00811.85
5.2.00.0130.00711.84
5.1.60.0100.00611.34
5.1.50.0090.00611.36
5.1.40.0110.00711.42
5.1.30.0070.00811.64
5.1.20.0090.00611.43
5.1.10.0100.00611.47
5.1.00.0090.00911.49
5.0.50.0100.00510.69
5.0.40.0060.00910.57
5.0.30.0080.00610.65
5.0.20.0110.00410.56
5.0.10.0070.00610.56
5.0.00.0080.00510.54
4.4.90.0080.00210.49
4.4.80.0070.00210.49
4.4.70.0040.00410.49
4.4.60.0070.00210.49
4.4.50.0060.00310.49
4.4.40.0060.00210.49
4.4.30.0060.00310.49
4.4.20.0080.00210.49
4.4.10.0050.00410.49
4.4.00.0060.00310.49
4.3.110.0060.00310.49
4.3.100.0080.00110.49
4.3.90.0050.00410.49
4.3.80.0070.00410.49
4.3.70.0060.00410.49
4.3.60.0070.00310.49
4.3.50.0050.00410.49
4.3.40.0080.00310.49
4.3.30.0020.00610.49
4.3.20.0030.00510.49
4.3.10.0020.00710.49
4.3.00.0020.00510.49

preferences:
32.32 ms | 403 KiB | 5 Q