3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _getRollingMonths($months = 12) { $currentTime = strtotime('2015-03-01'); $dates = array(); for($i=$months-1;$i>=0;$i--) { $dates[] = array( 'year' => date('Y', strtotime("first day of -$i months", $currentTime)), 'month' => date('m', strtotime("first day of -$i months", $currentTime)), 'monthName' => date('M', strtotime("first day of -$i months", $currentTime)) ); } return $dates; } function debug($var) { echo "<pre>"; print_r($var); echo "</pre>"; } debug(_getRollingMonths(15));

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.0100.01018.55
8.3.50.0170.00318.06
8.3.40.0070.01419.08
8.3.30.0110.00318.90
8.3.20.0000.00820.33
8.3.10.0070.00021.82
8.3.00.0120.00618.89
8.2.180.0150.00016.88
8.2.170.0130.00622.96
8.2.160.0110.00422.10
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00019.66
8.2.110.0070.00321.17
8.2.100.0090.00318.03
8.2.90.0000.00819.34
8.2.80.0050.00317.97
8.2.70.0060.00317.75
8.2.60.0030.00618.17
8.2.50.0040.00418.07
8.2.40.0000.00818.34
8.2.30.0050.00518.27
8.2.20.0050.00317.91
8.2.10.0040.00418.31
8.2.00.0000.00918.06
8.1.280.0100.01025.92
8.1.270.0040.00418.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.74
8.1.230.0030.00719.03
8.1.220.0040.00417.90
8.1.210.0040.00418.77
8.1.200.0060.00617.35
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0080.00018.75
8.1.160.0050.00322.04
8.1.150.0000.01018.87
8.1.140.0000.00819.41
8.1.130.0000.00717.86
8.1.120.0070.00017.68
8.1.110.0000.00817.63
8.1.100.0070.00017.64
8.1.90.0030.00517.71
8.1.80.0030.00617.52
8.1.70.0000.00717.68
8.1.60.0080.00017.84
8.1.50.0090.00017.70
8.1.40.0050.00517.75
8.1.30.0040.00417.72
8.1.20.0040.00417.89
8.1.10.0000.00817.63
8.1.00.0000.00817.73
8.0.300.0050.00318.77
8.0.290.0070.00017.00
8.0.280.0000.00718.58
8.0.270.0040.00417.40
8.0.260.0030.00317.30
8.0.250.0000.00717.16
8.0.240.0000.00817.23
8.0.230.0070.00017.25
8.0.220.0030.00317.13
8.0.210.0040.00417.13
8.0.200.0030.00317.13
8.0.190.0040.00417.13
8.0.180.0040.00417.19
8.0.170.0060.00317.21
8.0.160.0000.00717.25
8.0.150.0090.00017.07
8.0.140.0080.00017.00
8.0.130.0050.00313.50
8.0.120.0000.00817.02
8.0.110.0040.00417.13
8.0.100.0040.00417.04
8.0.90.0080.00016.99
8.0.80.0100.00317.18
8.0.70.0000.00717.20
8.0.60.0040.00417.16
8.0.50.0000.00716.94
8.0.30.0160.00817.38
8.0.20.0110.00717.40
8.0.10.0000.00717.26
8.0.00.0130.00717.06
7.4.330.0050.00015.19
7.4.320.0060.00016.64
7.4.300.0070.00016.63
7.4.290.0000.00716.86
7.4.280.0040.00416.79
7.4.270.0000.00716.86
7.4.260.0080.00416.59
7.4.250.0040.00416.69
7.4.240.0020.00516.74
7.4.230.0070.00016.70
7.4.220.0070.01816.68
7.4.210.0060.00916.61
7.4.200.0000.00716.81
7.4.160.0070.01316.72
7.4.150.0070.01117.40
7.4.140.0120.01017.86
7.4.130.0120.00916.70
7.4.120.0070.01016.67
7.4.110.0100.01016.79
7.4.100.0180.00416.81
7.4.90.0090.00916.67
7.4.80.0140.00719.39
7.4.70.0160.00016.67
7.4.60.0030.01516.66
7.4.50.0030.00316.80
7.4.40.0100.01016.66
7.4.30.0170.00716.91
7.4.00.0060.01215.13
7.3.330.0030.00313.42
7.3.320.0000.00513.39
7.3.310.0030.00316.62
7.3.300.0000.00716.55
7.3.290.0070.00916.59
7.3.280.0060.01116.57
7.3.270.0140.00617.40
7.3.260.0100.00716.73
7.3.250.0110.00616.68
7.3.240.0140.00716.72
7.3.230.0050.01316.54
7.3.210.0060.01216.63
7.3.200.0130.00319.39
7.3.190.0090.00916.66
7.3.180.0090.01216.73
7.3.170.0030.01616.85
7.3.160.0160.00016.72
7.3.00.0110.00017.13
7.2.330.0160.00616.88
7.2.320.0110.00617.15
7.2.310.0060.01617.06
7.2.300.0060.01217.15
7.2.290.0170.00617.07
7.2.130.0060.00317.15
7.2.120.0030.01217.34
7.2.110.0130.00317.22
7.2.100.0060.00617.32
7.2.90.0000.01817.03
7.2.80.0090.00617.01
7.2.70.0000.01417.25
7.2.60.0050.00917.03
7.2.50.0030.00916.97
7.2.40.0100.00717.18
7.2.30.0000.01317.06
7.2.20.0030.00716.94
7.2.10.0030.00717.34
7.2.00.0080.00518.18
7.1.250.0100.00316.16
7.1.240.0040.00416.00
7.1.230.0000.00815.89
7.1.220.0000.01116.02
7.1.210.0070.00315.89
7.1.200.0040.00915.95
7.1.190.0100.00015.82
7.1.180.0000.01115.72
7.1.170.0000.01416.07
7.1.160.0090.00315.99
7.1.150.0090.00016.17
7.1.140.0070.00716.23
7.1.130.0040.00416.04
7.1.120.0090.00615.52
7.1.110.0000.00716.19
7.1.100.0050.00817.33
7.1.90.0040.00416.09
7.1.80.0040.00715.99
7.1.70.0040.00716.70
7.1.60.0050.01117.67
7.1.50.0110.01125.67
7.1.40.0090.00015.94
7.1.30.0030.01016.06
7.1.20.0040.00815.84
7.1.10.0060.00916.13
7.1.00.0050.04319.07
7.0.330.0030.01315.66
7.0.320.0080.00415.76
7.0.310.0060.00615.60
7.0.300.0060.00615.39
7.0.290.0050.00315.59
7.0.280.0090.00315.79
7.0.270.0030.00515.50
7.0.260.0060.00315.43
7.0.250.0030.01215.63
7.0.240.0060.00915.62
7.0.230.0060.00615.55
7.0.220.0000.01115.65
7.0.210.0030.01015.64
7.0.200.0020.00816.29
7.0.190.0060.00915.61
7.0.180.0030.00615.65
7.0.170.0030.00715.66
7.0.160.0000.01515.51
7.0.150.0090.00315.41
7.0.140.0020.02318.93
7.0.130.0000.01015.68
7.0.120.0030.00715.59
7.0.110.0000.00815.73
7.0.100.0080.03717.86
7.0.90.0030.02517.80
7.0.80.0150.04017.80
7.0.70.0120.04017.79
7.0.60.0100.04117.75
7.0.50.0050.04017.93
7.0.40.0120.04216.99
7.0.30.0130.02016.86
7.0.20.0080.03016.78
7.0.10.0080.03916.77
7.0.00.0150.03216.72
5.6.380.0060.00914.08
5.6.370.0070.01014.30
5.6.360.0070.00714.52
5.6.350.0090.00314.37
5.6.340.0100.00614.80
5.6.330.0030.01014.40
5.6.320.0090.00014.76
5.6.310.0060.00614.59
5.6.300.0060.00614.39
5.6.290.0090.00614.24
5.6.280.0030.04517.72
5.6.270.0090.00314.55
5.6.260.0070.00414.64
5.6.250.0070.04517.46
5.6.240.0080.04517.58
5.6.230.0100.04217.54
5.6.220.0100.02717.70
5.6.210.0100.02917.60
5.6.200.0060.04617.76
5.6.190.0080.04317.76
5.6.180.0050.03717.68
5.6.170.0080.04817.92
5.6.160.0130.04017.72
5.6.150.0070.03517.73
5.6.140.0100.03317.92
5.6.130.0050.04718.01
5.6.120.0070.04817.74
5.6.110.0080.05017.87
5.6.100.0080.04717.73
5.6.90.0030.04717.75
5.6.80.0070.03617.41
5.6.70.0060.02617.58
5.6.60.0120.03717.50
5.6.50.0050.02817.42
5.6.40.0050.02617.56
5.6.30.0030.05117.50
5.6.20.0070.02817.38
5.6.10.0030.03917.40
5.6.00.0040.04217.49
5.5.380.0120.03816.01
5.5.370.0090.02016.12
5.5.360.0110.02215.82
5.5.350.0090.03515.91
5.5.340.0120.04016.19
5.5.330.0120.03816.16
5.5.320.0050.02516.10
5.5.310.0070.04516.21
5.5.300.0070.03916.16
5.5.290.0100.02516.04
5.5.280.0020.04716.22
5.5.270.0100.03515.92
5.5.260.0120.03915.94
5.5.250.0110.03615.98
5.5.240.0070.03515.86
5.5.230.0080.02315.83
5.5.220.0030.02315.66
5.5.210.0070.02415.81
5.5.200.0070.03715.74
5.5.190.0050.02815.71
5.5.180.0050.03715.72
5.5.170.0030.00611.21
5.5.160.0000.03315.84
5.5.150.0050.04115.68
5.5.140.0070.02515.71
5.5.130.0080.03215.77
5.5.120.0030.03015.78
5.5.110.0050.04515.77
5.5.100.0030.03015.66
5.5.90.0110.02815.70
5.5.80.0030.02915.78
5.5.70.0030.03015.66
5.5.60.0040.04315.60
5.5.50.0120.03915.67
5.5.40.0080.04315.70
5.5.30.0070.02615.72
5.5.20.0170.03315.65
5.5.10.0050.02915.78
5.5.00.0070.02915.66
5.4.450.0070.03315.37
5.4.440.0030.04215.49
5.4.430.0100.04215.43
5.4.420.0050.04515.30
5.4.410.0060.04115.41
5.4.400.0030.04715.22
5.4.390.0070.04115.23
5.4.380.0100.03015.22
5.4.370.0050.03315.17
5.4.360.0100.04115.15
5.4.350.0080.03715.13
5.4.340.0030.03415.18
5.4.330.0000.00711.46
5.4.320.0070.03815.12
5.4.310.0050.04215.19
5.4.300.0090.03515.10
5.4.290.0060.04315.05
5.4.280.0130.04015.33
5.4.270.0100.04415.15
5.4.260.0080.02215.13
5.4.250.0130.02515.24
5.4.240.0100.02215.19
5.4.230.0110.03515.12
5.4.220.0030.03615.24
5.4.210.0080.03715.07
5.4.200.0050.04315.27
5.4.190.0070.03515.11
5.4.180.0100.03215.16
5.4.170.0050.04515.07
5.4.160.0070.04015.12
5.4.150.0020.03815.03
5.4.140.0080.03213.84
5.4.130.0060.04013.68
5.4.120.0050.02513.77
5.4.110.0090.04013.83
5.4.100.0060.02313.75
5.4.90.0070.02313.74
5.4.80.0070.04013.85
5.4.70.0080.03513.85
5.4.60.0070.03013.81
5.4.50.0070.04013.76
5.4.40.0030.02413.90
5.4.30.0080.03813.89
5.4.20.0130.01713.90
5.4.10.0050.03013.86
5.4.00.0030.04513.61
5.3.290.0060.02612.83
5.3.280.0110.02612.76
5.3.270.0030.04512.75
5.3.260.0030.02812.80
5.3.250.0040.04412.81
5.3.240.0090.03612.69
5.3.230.0070.04012.76
5.3.220.0050.04312.71
5.3.210.0040.04312.49
5.3.200.0070.04012.66
5.3.190.0060.03312.75
5.3.180.0020.04512.78
5.3.170.0060.04812.72
5.3.160.0030.04512.80
5.3.150.0080.04212.71
5.3.140.0050.04312.70
5.3.130.0050.04012.63
5.3.120.0080.04012.67
5.3.110.0030.04112.71
5.3.100.0090.04012.33
5.3.90.0050.03512.32
5.3.80.0050.03612.36
5.3.70.0030.02712.20
5.3.60.0070.03112.31
5.3.50.0080.02812.42
5.3.40.0090.02512.39
5.3.30.0050.03312.32
5.3.20.0090.03912.17
5.3.10.0070.03812.09
5.3.00.0090.03712.09
5.2.170.0030.02510.62
5.2.160.0030.03510.62
5.2.150.0030.03010.64
5.2.140.0070.03610.62
5.2.130.0080.03110.62
5.2.120.0020.02410.62
5.2.110.0020.02310.62
5.2.100.0030.03710.62
5.2.90.0030.02010.62
5.2.80.0030.02810.63
5.2.70.0070.03510.62
5.2.60.0070.02810.62
5.2.50.0070.03110.62
5.2.40.0050.02210.62
5.2.30.0080.03310.62
5.2.20.0060.03110.62
5.2.10.0010.02910.62
5.2.00.0070.03310.62
5.1.60.0030.01510.62
5.1.50.0030.01810.62
5.1.40.0070.02210.62
5.1.30.0030.02910.62
5.1.20.0030.03310.62
5.1.10.0050.01710.62
5.1.00.0030.02710.62
5.0.50.0070.01810.62
5.0.40.0080.01310.62
5.0.30.0030.01810.62
5.0.20.0040.02210.62
5.0.10.0020.02010.62
5.0.00.0050.01710.62
4.4.90.0060.01510.62
4.4.80.0080.01610.62
4.4.70.0020.02210.62
4.4.60.0030.01010.62
4.4.50.0070.01810.62
4.4.40.0020.02710.62
4.4.30.0020.02010.62
4.4.20.0030.01810.62
4.4.10.0020.02210.62
4.4.00.0020.03010.62
4.3.110.0080.01710.62
4.3.100.0020.02610.62
4.3.90.0050.01210.62
4.3.80.0040.01310.62
4.3.70.0020.01010.62
4.3.60.0030.01710.62
4.3.50.0020.01310.62
4.3.40.0060.01010.62
4.3.30.0010.01110.62
4.3.20.0040.00710.62
4.3.10.0020.01210.62
4.3.00.0020.01210.62

preferences:
51.58 ms | 400 KiB | 5 Q