3v4l.org

run code in 300+ PHP versions simultaneously
<?php function period_to_timestamps($period) { switch($period) { case "last_7_days": $start = strtotime('-7 days'); $end = strtotime('now'); break; case "this_month": $start = strtotime('first day of this month'); $end = strtotime('now'); break; case "last_month": $start = strtotime('first day of last month'); $end = strtotime('last day of last month'); break; case "this_year": $start = strtotime('01-01-' . date('Y', strtotime('now'))); $end = strtotime('now'); break; case "last_year": $start = strtotime('01/01/' . date('Y', strtotime('now -1 year'))); $end = strtotime('12/31/' . date('Y', strtotime('now -1 year'))); break; default: $start = strtotime('now'); $end = strtotime('now'); } return array(date('m-d-Y', $start), date('m-d-Y', $end)); } var_dump(period_to_timestamps('last_7_days')); var_dump(period_to_timestamps('this_month')); var_dump(period_to_timestamps('last_month')); var_dump(period_to_timestamps('this_year')); var_dump(period_to_timestamps('last_year'));

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.0160.00321.97
8.3.40.0030.01318.96
8.3.30.0100.00619.13
8.3.20.0040.00420.38
8.3.10.0060.00323.54
8.3.00.0030.00620.99
8.2.180.0110.00718.43
8.2.170.0170.00322.96
8.2.160.0090.00620.49
8.2.150.0080.00024.18
8.2.140.0060.00924.66
8.2.130.0050.00226.16
8.2.120.0000.00720.90
8.2.110.0090.00022.33
8.2.100.0080.00419.82
8.2.90.0040.00419.40
8.2.80.0050.00317.97
8.2.70.0030.00817.75
8.2.60.0000.01117.93
8.2.50.0000.00818.07
8.2.40.0000.00819.95
8.2.30.0070.00318.36
8.2.20.0050.00317.89
8.2.10.0000.00718.29
8.2.00.0000.00817.82
8.1.280.0040.01125.92
8.1.270.0000.00724.04
8.1.260.0030.00526.35
8.1.250.0090.00028.09
8.1.240.0060.00322.24
8.1.230.0060.00619.22
8.1.220.0030.00517.91
8.1.210.0030.00518.77
8.1.200.0060.00317.50
8.1.190.0000.00817.25
8.1.180.0080.00418.10
8.1.170.0080.00018.90
8.1.160.0040.00422.18
8.1.150.0040.00418.78
8.1.140.0030.00617.72
8.1.130.0070.00018.00
8.1.120.0040.00417.70
8.1.110.0000.00817.63
8.1.100.0040.00417.74
8.1.90.0040.00417.75
8.1.80.0070.00317.72
8.1.70.0030.00317.59
8.1.60.0050.00217.68
8.1.50.0040.00417.65
8.1.40.0040.00417.74
8.1.30.0060.00317.87
8.1.20.0050.00217.84
8.1.10.0000.00817.66
8.1.00.0080.00017.76
8.0.300.0030.00618.77
8.0.290.0000.00717.30
8.0.280.0040.00418.55
8.0.270.0040.00417.32
8.0.260.0030.00317.32
8.0.250.0030.00317.20
8.0.240.0060.00317.27
8.0.230.0030.00317.27
8.0.220.0000.00717.06
8.0.210.0030.00317.07
8.0.200.0070.00017.27
8.0.190.0040.00417.27
8.0.180.0000.00817.10
8.0.170.0030.00617.18
8.0.160.0040.00417.16
8.0.150.0070.00417.00
8.0.140.0040.00417.14
8.0.130.0030.00313.49
8.0.120.0060.00317.02
8.0.110.0030.00617.07
8.0.100.0000.00717.13
8.0.90.0050.00217.13
8.0.80.0160.00717.18
8.0.70.0080.00017.22
8.0.60.0040.00416.96
8.0.50.0000.00717.08
8.0.30.0100.01017.15
8.0.20.0140.00517.44
8.0.10.0000.00717.24
8.0.00.0070.01016.92
7.4.330.0000.00515.20
7.4.320.0000.00616.82
7.4.300.0030.00316.77
7.4.290.0030.00316.71
7.4.280.0000.00716.61
7.4.270.0030.00316.71
7.4.260.0030.00316.79
7.4.250.0000.00816.73
7.4.240.0040.00416.79
7.4.230.0000.00716.91
7.4.220.0130.00616.68
7.4.210.0100.00416.76
7.4.200.0030.00516.79
7.4.190.0030.00516.68
7.4.160.0090.00916.97
7.4.150.0060.01217.40
7.4.140.0040.01417.86
7.4.130.0120.00616.73
7.4.120.0070.01116.61
7.4.110.0090.00916.76
7.4.100.0040.01417.02
7.4.90.0100.00716.86
7.4.80.0160.00719.39
7.4.70.0110.00616.95
7.4.60.0110.00716.90
7.4.50.0030.00616.85
7.4.40.0100.00716.89
7.4.30.0070.01016.82
7.4.00.0100.00315.38
7.3.330.0000.00613.23
7.3.320.0000.00613.20
7.3.310.0040.00416.47
7.3.300.0000.00716.40
7.3.290.0070.00716.43
7.3.280.0100.00916.44
7.3.270.0000.01817.40
7.3.260.0090.00916.75
7.3.250.0090.00916.67
7.3.240.0140.00416.69
7.3.230.0150.00616.48
7.3.210.0120.00616.73
7.3.200.0060.01319.39
7.3.190.0110.00716.87
7.3.180.0030.01216.63
7.3.170.0150.00916.36
7.3.160.0030.01316.69
7.3.120.0070.00715.04
7.2.330.0110.00716.79
7.2.320.0130.00717.01
7.2.310.0210.00016.85
7.2.300.0070.01417.10
7.2.290.0100.01316.61
7.2.00.0030.01419.68
7.1.100.0060.00618.26
7.1.70.0030.00617.36
7.1.60.0070.01719.46
7.1.50.0150.00916.86
7.1.00.0070.07322.40
7.0.200.0060.00316.75
7.0.140.0070.07021.95
7.0.110.0070.08019.94
7.0.100.0130.08319.98
7.0.90.0070.07019.91
7.0.80.0100.07319.86
7.0.70.0030.08719.86
7.0.60.0230.06719.98
7.0.50.0230.04320.27
7.0.40.0070.07020.04
7.0.30.0030.04320.28
7.0.20.0030.04020.22
7.0.10.0070.04720.27
7.0.00.0070.04020.02
5.6.280.0030.07321.10
5.6.260.0000.05320.57
5.6.250.0100.07720.62
5.6.240.0130.08020.62
5.6.230.0100.07020.63
5.6.220.0170.08020.63
5.6.210.0030.08720.77
5.6.200.0100.05720.98
5.6.190.0070.04721.04
5.6.180.0070.04021.15
5.6.170.0100.04021.21
5.6.160.0070.05721.13
5.6.150.0030.04021.15
5.6.140.0070.04021.18
5.6.130.0070.08021.05
5.6.120.0000.07720.96
5.6.110.0100.07320.92
5.6.100.0000.04720.93
5.6.90.0100.08021.26
5.6.80.0100.03320.38
5.6.70.0070.03720.41
5.6.60.0130.04320.65
5.6.50.0070.03320.61
5.6.40.0000.04320.50
5.6.30.0030.04020.48
5.6.20.0070.03020.50
5.6.10.0030.07320.29
5.6.00.0000.04020.31
5.5.380.0100.07320.28
5.5.370.0130.07020.47
5.5.360.0070.06720.19
5.5.350.0200.06020.44
5.5.340.0030.04720.79
5.5.330.0070.03720.96
5.5.320.0030.04320.86
5.5.310.0030.05721.05
5.5.300.0070.07320.81
5.5.290.0170.02720.82
5.5.280.0100.07720.96
5.5.270.0070.06320.96
5.5.260.0070.06720.75
5.5.250.0000.04320.66
5.5.240.0130.03320.27
5.5.230.0070.04020.28
5.5.220.0030.04020.29
5.5.210.0030.05720.09
5.5.200.0070.03720.18
5.5.190.0030.05720.34
5.5.180.0000.04320.38
5.5.160.0030.03720.17
5.5.150.0100.06320.37
5.5.140.0030.04020.13
5.5.130.0030.04320.39
5.5.120.0030.04020.26
5.5.110.0070.04320.24
5.5.100.0070.04320.21
5.5.90.0030.03720.20
5.5.80.0070.04320.16
5.5.70.0030.03720.17
5.5.60.0030.03320.24
5.5.50.0030.04020.02
5.5.40.0100.03319.98
5.5.30.0030.08020.10
5.5.20.0230.04720.25
5.5.10.0070.04320.07
5.5.00.0170.07020.20
5.4.450.0070.07719.64
5.4.440.0070.08019.31
5.4.430.0100.05019.48
5.4.420.0070.04019.48
5.4.410.0030.04019.20
5.4.400.0100.08019.34
5.4.390.0070.06719.18
5.4.380.0000.03719.00
5.4.370.0070.03719.32
5.4.360.0030.03719.00
5.4.350.0000.04019.00
5.4.340.0030.05318.99
5.4.320.0130.02719.09
5.4.310.0030.03319.20
5.4.300.0070.05718.98
5.4.290.0070.07319.23
5.4.280.0000.04018.99
5.4.270.0030.03719.00
5.4.260.0000.04019.01
5.4.250.0030.03319.00
5.4.240.0030.04319.16
5.4.230.0030.03319.17
5.4.220.0070.04018.98
5.4.210.0070.04018.98
5.4.200.0030.03719.18
5.4.190.0100.05319.30
5.4.180.0100.07018.97
5.4.170.0070.05019.01
5.4.160.0130.07019.03
5.4.150.0070.08019.23
5.4.140.0100.06316.58
5.4.130.0100.05316.45
5.4.120.0030.05016.34
5.4.110.0070.07316.37
5.4.100.0070.07016.56
5.4.90.0030.07716.56
5.4.80.0030.05016.50
5.4.70.0000.08016.43
5.4.60.0130.06716.39
5.4.50.0070.07316.54
5.4.40.0100.07016.58
5.4.30.0100.07316.47
5.4.20.0030.07316.35
5.4.10.0100.07316.54
5.4.00.0100.06315.74
5.3.290.0030.05014.81
5.3.280.0070.05714.61
5.3.270.0100.06314.64
5.3.260.0100.07714.47
5.3.250.0130.06014.63
5.3.240.0030.07314.77
5.3.230.0100.07314.65
5.3.220.0100.07314.45
5.3.210.0100.06714.60
5.3.200.0070.07014.71
5.3.190.0000.08714.71
5.3.180.0030.08014.70
5.3.170.0000.08314.66
5.3.160.0030.07314.70
5.3.150.0070.04014.59
5.3.140.0130.06714.56
5.3.130.0000.08014.42
5.3.120.0130.07014.58
5.3.110.0030.07714.71
5.3.100.0070.07713.91
5.3.90.0130.07314.17
5.3.80.0100.06714.04
5.3.70.0130.04714.04
5.3.60.0100.06713.96
5.3.50.0130.06014.00
5.3.40.0100.07014.04
5.3.30.0030.06313.93
5.3.20.0070.07313.73
5.3.10.0030.07313.69
5.3.00.0070.07013.68
5.2.170.0100.06012.18
5.2.160.0030.05312.18
5.2.150.0070.06012.18
5.2.140.0100.05312.18
5.2.130.0030.03712.18
5.2.120.0100.05312.18
5.2.110.0030.06312.18
5.2.100.0030.06312.18
5.2.90.0100.06012.18
5.2.80.0070.06012.18
5.2.70.0100.05712.18
5.2.60.0000.06012.18
5.2.50.0030.04712.18
5.2.40.0100.05312.18
5.2.30.0070.06012.18
5.2.20.0000.06312.18
5.2.10.0030.06312.18
5.2.00.0030.06312.18
5.1.60.0030.05312.18
5.1.50.0000.06012.18
5.1.40.0030.05712.18
5.1.30.0070.03012.18
5.1.20.0070.02712.18
5.1.10.0000.06012.18
5.1.00.0070.05312.18
5.0.50.0030.04312.18
5.0.40.0070.03712.18
5.0.30.0100.05712.18
5.0.20.0030.04012.18
5.0.10.0070.04012.18
5.0.00.0070.06312.18
4.4.90.0070.03012.18
4.4.80.0070.03012.18
4.4.70.0030.03712.18
4.4.60.0030.03312.18
4.4.50.0030.03312.18
4.4.40.0000.05712.18
4.4.30.0070.03012.18
4.4.20.0000.04012.18
4.4.10.0000.03312.18
4.4.00.0070.04712.18
4.3.110.0030.03712.18
4.3.100.0000.03712.18
4.3.90.0100.02712.18
4.3.80.0000.05312.18
4.3.70.0070.02712.18
4.3.60.0070.03012.18
4.3.50.0070.03312.18
4.3.40.0030.04712.18
4.3.30.0000.03712.18
4.3.20.0070.03312.18
4.3.10.0070.03012.18
4.3.00.0070.03012.18

preferences:
47.53 ms | 401 KiB | 5 Q