3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTimeRange($month) { $month = str_pad($month, 2, '0', STR_PAD_LEFT); $year = $month > date('m') ? date('Y') - 1 : date('Y'); $start_date = "{$year}-{$month}-01"; $end_date = date('Y-m-d', strtotime("+1 month", strtotime($start_date))); return array( 'start_date' => $start_date, 'end_date' => $end_date ); } function getTimeRange2($month, $year = 0) { $month = str_pad($month, 2, '0', STR_PAD_LEFT); $year = ($year ? : ($month > date('m') ? date('Y') - 1 : date('Y'))); $start_date = "{$year}-{$month}-01"; $end_date = date('Y-m-d', strtotime("+1 month", strtotime($start_date))); return array('start_date'=>$start_date,'end_date'=>$end_date); } var_dump(getTimeRange(1)); var_dump(getTimeRange2(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.0180.00416.88
8.3.50.0080.00818.42
8.3.40.0090.00619.14
8.3.30.0040.01218.94
8.3.20.0060.00920.94
8.3.10.0000.00821.78
8.3.00.0040.00417.75
8.2.180.0070.00716.61
8.2.170.0150.00322.96
8.2.160.0000.01520.44
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0040.00419.97
8.2.120.0040.00426.35
8.2.110.0030.00621.03
8.2.100.0040.00817.97
8.2.90.0040.00418.09
8.2.80.0040.00418.22
8.2.70.0040.00418.05
8.2.60.0030.00517.88
8.2.50.0060.00318.10
8.2.40.0040.00420.55
8.2.30.0040.00419.47
8.2.20.0000.00818.34
8.2.10.0000.00818.32
8.2.00.0000.00818.01
8.1.280.0090.00625.92
8.1.270.0000.00822.17
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00022.58
8.1.230.0060.00621.04
8.1.220.0000.00917.74
8.1.210.0000.00918.93
8.1.200.0000.00817.48
8.1.190.0030.00517.48
8.1.180.0070.00018.10
8.1.170.0030.00620.66
8.1.160.0000.00819.04
8.1.150.0030.00520.36
8.1.140.0040.00419.65
8.1.130.0000.00819.16
8.1.120.0040.00417.75
8.1.110.0040.00417.61
8.1.100.0030.00617.76
8.1.90.0000.00817.62
8.1.80.0040.00417.77
8.1.70.0000.00717.63
8.1.60.0060.00317.81
8.1.50.0080.00017.69
8.1.40.0000.00817.63
8.1.30.0050.00317.72
8.1.20.0000.00917.85
8.1.10.0000.00817.79
8.1.00.0000.00817.78
8.0.300.0000.00720.23
8.0.290.0000.00717.13
8.0.280.0080.00018.60
8.0.270.0040.00417.36
8.0.260.0030.00317.33
8.0.250.0030.00317.15
8.0.240.0000.00717.11
8.0.230.0000.00717.22
8.0.220.0000.00717.19
8.0.210.0050.00317.17
8.0.200.0000.00617.22
8.0.190.0040.00417.14
8.0.180.0000.00717.24
8.0.170.0040.00417.21
8.0.160.0030.00517.17
8.0.150.0040.00417.16
8.0.140.0000.00817.16
8.0.130.0040.00413.53
8.0.120.0000.00917.14
8.0.110.0040.00417.01
8.0.100.0040.00417.30
8.0.90.0030.00517.14
8.0.80.0100.00717.23
8.0.70.0050.00317.07
8.0.60.0000.00817.00
8.0.50.0040.00417.18
8.0.30.0100.00817.33
8.0.20.0110.00817.49
8.0.10.0040.00417.20
8.0.00.0060.01216.79
7.4.330.0000.00615.55
7.4.320.0000.00616.80
7.4.300.0030.00316.83
7.4.290.0000.00716.83
7.4.280.0040.00416.68
7.4.270.0030.00516.82
7.4.260.0030.00416.71
7.4.250.0040.00416.69
7.4.240.0030.00316.66
7.4.230.0000.00716.69
7.4.220.0130.01016.87
7.4.210.0030.01716.78
7.4.200.0050.00316.65
7.4.160.0100.00916.82
7.4.150.0160.00317.40
7.4.140.0090.00917.86
7.4.130.0100.00716.83
7.4.120.0160.00416.96
7.4.110.0150.00916.70
7.4.100.0060.01416.82
7.4.90.0100.01016.80
7.4.80.0100.00719.39
7.4.70.0070.01016.77
7.4.60.0090.00616.82
7.4.50.0040.01416.78
7.4.40.0130.00416.88
7.4.30.0150.00416.88
7.4.00.0060.01215.16
7.3.330.0050.00013.38
7.3.320.0060.00013.54
7.3.310.0040.00416.58
7.3.300.0000.00716.46
7.3.290.0050.01316.58
7.3.280.0100.01016.56
7.3.270.0080.00817.40
7.3.260.0120.01116.76
7.3.250.0110.01116.65
7.3.240.0100.00716.71
7.3.230.0070.01016.87
7.3.210.0030.01316.79
7.3.200.0120.00616.91
7.3.190.0110.01216.58
7.3.180.0080.00816.67
7.3.170.0100.00716.81
7.3.160.0080.01216.48
7.3.120.0040.01415.44
7.3.110.0090.00915.10
7.3.100.0080.00814.96
7.3.90.0030.01414.93
7.3.80.0100.00315.04
7.3.70.0030.01314.93
7.3.60.0000.01015.11
7.3.50.0090.00614.88
7.3.40.0060.01015.20
7.3.30.0050.00515.03
7.3.20.0040.01116.77
7.3.10.0060.00916.95
7.3.00.0120.00316.52
7.2.330.0090.00916.72
7.2.320.0100.00916.77
7.2.310.0090.00616.91
7.2.300.0090.01516.82
7.2.290.0140.00316.74
7.2.250.0100.01015.05
7.2.240.0070.01315.07
7.2.230.0060.01315.08
7.2.220.0070.00315.07
7.2.210.0030.01015.46
7.2.200.0030.00815.05
7.2.190.0040.00815.13
7.2.180.0090.00915.31
7.2.170.0060.00915.38
7.2.60.0090.00317.09
7.1.330.0070.00716.01
7.1.320.0030.00916.25
7.1.310.0000.01615.61
7.1.300.0070.00715.96
7.1.290.0120.00316.13
7.1.280.0030.00716.04
7.1.270.0000.01216.01
7.1.260.0060.00916.20
7.1.200.0070.00715.75
7.1.70.0030.00817.48
7.1.60.0040.01117.43
7.1.00.0100.05322.50
7.0.200.0030.01316.93
7.0.140.0070.05721.88
7.0.130.0070.05722.04
7.0.120.0030.05722.14
7.0.110.0100.05322.10
7.0.100.0170.04721.95
7.0.90.0130.05321.99
7.0.80.0200.04722.06
7.0.70.0070.05321.95
7.0.60.0130.06322.14
7.0.50.0070.05322.02
7.0.40.0100.05022.13
7.0.30.0170.05722.17
7.0.20.0070.05721.98
7.0.10.0030.06322.15
7.0.00.0070.06021.97
5.6.290.0070.05720.77
5.6.280.0000.06020.93
5.6.270.0070.07020.91
5.6.260.0230.04321.11
5.6.250.0100.05020.89
5.6.240.0000.06320.90
5.6.230.0130.05021.15
5.6.220.0070.05320.95
5.6.210.0130.05020.94
5.6.200.0030.06021.08
5.6.190.0030.06021.08
5.6.180.0070.05720.89
5.6.170.0030.06020.89
5.6.160.0030.06021.06
5.6.150.0030.06021.00
5.6.140.0070.06720.74
5.6.130.0170.04720.74
5.6.120.0130.05320.92
5.6.110.0170.05020.72
5.6.100.0030.06020.77
5.6.90.0070.05721.01
5.6.80.0100.05320.42
5.6.70.0030.05720.45
5.6.60.0170.05020.26
5.6.50.0130.04720.16
5.6.40.0070.05320.21
5.6.30.0030.06720.21
5.6.20.0100.05320.14
5.6.10.0030.05320.13
5.6.00.0130.04320.20

preferences:
59.5 ms | 401 KiB | 5 Q