3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 'Y-100;Y+10'; $arrvalidrules = explode(';', $value); // On vérifie qu'il n'y bien que deux valeurs. if (count($arrvalidrules) == 2) { $arrvarlabels = array('intyearstart', 'intyearend'); foreach ($arrvarlabels as $key => $label) { if ($arrvalidrules[$key]!='') { if (is_numeric($arrvalidrules[$key])) { ${$label} = intval($arrvalidrules[$key]); } else if (strpos($arrvalidrules[$key], 'Y') === 0) { ${$label} = date('Y'); if (($intsignpos = strpos($arrvalidrules[$key], '+')) !== false) { ${$label} += intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } else if (($intsignpos = strpos($arrvalidrules[$key], '-')) !== false) { ${$label} -= intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } } else { ${$label} = ($key == 0 ? 0 : null); } } else { ${$label} = ($key == 0 ? 0 : null); } } } echo 'Date : '.$intyearstart.' - '.$intyearend;

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.70.0040.01516.63
8.3.60.0170.00318.56
8.3.50.0230.01122.11
8.3.40.0110.00719.10
8.3.30.0070.00719.01
8.3.20.0000.00818.86
8.3.10.0040.00421.17
8.3.00.0030.00621.68
8.2.180.0190.00316.63
8.2.170.0100.00722.96
8.2.160.0070.00720.40
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0030.00520.95
8.2.110.0140.00721.05
8.2.100.0040.00717.97
8.2.90.0050.00319.17
8.2.80.0070.00318.03
8.2.70.0060.00317.50
8.2.60.0060.00318.18
8.2.50.0080.00018.07
8.2.40.0000.00818.28
8.2.30.0040.00419.52
8.2.20.0070.00017.67
8.2.10.0000.00717.88
8.2.00.0040.00817.78
8.1.280.0100.00725.92
8.1.270.0050.00323.99
8.1.260.0040.00826.35
8.1.250.0000.00728.09
8.1.240.0000.00922.73
8.1.230.0080.00419.16
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0000.00917.38
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0080.00018.41
8.1.160.0040.00418.90
8.1.150.0000.00718.83
8.1.140.0040.00417.59
8.1.130.0030.00517.88
8.1.120.0040.00417.65
8.1.110.0040.00417.55
8.1.100.0070.00017.66
8.1.90.0000.00717.58
8.1.80.0000.00817.61
8.1.70.0040.00417.54
8.1.60.0000.00917.54
8.1.50.0040.00417.38
8.1.40.0000.00717.56
8.1.30.0000.00817.73
8.1.20.0000.00817.61
8.1.10.0020.00517.71
8.1.00.0070.00017.63
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0070.00018.52
8.0.270.0070.00017.39
8.0.260.0030.00316.98
8.0.250.0040.00417.04
8.0.240.0040.00417.06
8.0.230.0000.00717.05
8.0.220.0040.00416.95
8.0.210.0030.00316.95
8.0.200.0070.00017.02
8.0.190.0030.00616.96
8.0.180.0000.00717.00
8.0.170.0000.00817.00
8.0.160.0040.00416.96
8.0.150.0000.00716.93
8.0.140.0030.00416.95
8.0.130.0050.00013.40
8.0.120.0000.00916.92
8.0.110.0000.00716.88
8.0.100.0000.00717.02
8.0.90.0050.00216.87
8.0.80.0080.00816.96
8.0.70.0000.00816.97
8.0.60.0000.00716.86
8.0.50.0070.00016.93
8.0.30.0120.00717.28
8.0.20.0100.00817.40
8.0.10.0000.00717.01
8.0.00.0090.01116.67
7.4.330.0000.00516.84
7.4.320.0030.00316.70
7.4.300.0060.00016.45
7.4.290.0030.00316.74
7.4.280.0000.00716.73
7.4.270.0000.00616.63
7.4.260.0050.00013.33
7.4.250.0040.00416.46
7.4.240.0030.00316.70
7.4.230.0070.00016.74
7.4.220.0150.00916.54
7.4.210.0050.01016.65
7.4.200.0040.00416.65
7.4.190.0070.00016.54
7.4.160.0150.00016.59
7.4.150.0040.01417.40
7.4.140.0100.00717.86
7.4.130.0080.00816.55
7.4.120.0140.00416.58
7.4.110.0070.01016.49
7.4.100.0090.00916.79
7.4.90.0130.00616.54
7.4.80.0100.00719.39
7.4.70.0090.00616.66
7.4.60.0180.01016.50
7.4.50.0000.00716.77
7.4.40.0090.00922.77
7.4.30.0030.01616.60
7.4.00.0060.00615.05
7.3.330.0040.00413.27
7.3.320.0030.00313.30
7.3.310.0030.00316.47
7.3.300.0070.00016.41
7.3.290.0110.00316.44
7.3.280.0100.00616.44
7.3.270.0130.01017.40
7.3.260.0110.00918.24
7.3.250.0110.01216.64
7.3.240.0100.00716.70
7.3.230.0070.01316.46
7.3.210.0070.01116.50
7.3.200.0040.01119.39
7.3.190.0090.01216.52
7.3.180.0120.00616.67
7.3.170.0100.00716.35
7.3.160.0080.00816.50
7.3.120.0100.00715.21
7.3.10.0130.00016.32
7.3.00.0170.00316.19
7.2.330.0120.00616.66
7.2.320.0060.01216.82
7.2.310.0110.00816.76
7.2.300.0060.00916.62
7.2.290.0030.01716.74
7.2.130.0070.01016.92
7.2.120.0140.00416.97
7.2.110.0200.00816.92
7.2.100.0190.00316.81
7.2.90.0120.01216.64
7.2.80.0100.00716.43
7.2.70.0300.00016.78
7.2.60.0110.00616.96
7.2.50.0290.01117.09
7.2.40.0080.02216.83
7.2.30.0200.00516.93
7.2.20.0140.01417.10
7.2.10.0150.01216.88
7.2.00.0130.01317.03
7.1.250.0260.00315.92
7.1.200.0090.00315.61
7.1.100.0060.00618.28
7.1.70.0000.01217.25
7.1.60.0170.00719.08
7.1.50.0100.01717.19
7.1.00.0070.03022.25
7.0.200.0000.00816.98
7.0.140.0100.06722.12
7.0.100.0530.08019.96
7.0.90.0070.09319.97
7.0.80.0500.06019.93
7.0.70.0400.08719.98
7.0.60.0370.08719.94
7.0.50.0430.04020.22
7.0.40.0070.08720.04
7.0.30.0070.06320.09
7.0.20.0100.07320.14
7.0.10.0200.07320.09
7.0.00.0070.05720.00
5.6.280.0000.07721.11
5.6.250.0030.08320.63
5.6.240.0130.06720.60
5.6.230.0070.08020.50
5.6.220.0130.08020.53
5.6.210.0130.06320.65
5.6.200.0100.08721.13
5.6.190.0130.07320.95
5.6.180.0130.05721.11
5.6.170.0170.05321.09
5.6.160.0130.07721.00
5.6.150.0070.07721.05
5.6.140.0100.07721.11
5.6.130.0130.08021.02
5.6.120.0130.07720.95
5.6.110.0000.06720.90
5.6.100.0130.07321.03
5.6.90.0170.07021.03
5.6.80.0030.05020.45
5.6.70.0070.03720.29
5.6.60.0130.04720.55
5.6.50.0030.04320.41
5.6.40.0070.07720.45
5.6.30.0100.07720.44
5.6.20.0000.08320.31
5.6.10.0000.05320.49
5.6.00.0070.07320.37
5.5.380.0100.07320.46
5.5.370.0100.07020.36
5.5.360.0100.07020.41
5.5.350.0130.04020.45
5.5.340.0000.07320.89
5.5.330.0130.07720.63
5.5.320.0000.08720.69
5.5.310.0070.10020.87
5.5.300.0070.06020.93
5.5.290.0070.06720.80
5.5.280.0030.08320.88
5.5.270.0100.07720.75
5.5.260.0100.05720.90
5.5.250.0100.07020.66
5.5.240.0100.04020.19
5.5.230.0070.03720.21
5.5.220.0030.04020.30
5.5.210.0070.03720.15
5.5.200.0070.03720.15
5.5.190.0030.08020.24
5.5.180.0100.03720.24
5.5.160.0100.05020.27
5.5.150.0030.08020.19
5.5.140.0130.04020.24
5.5.130.0170.07020.19
5.5.120.0070.06720.21
5.5.110.0070.04320.24
5.5.100.0030.04320.07
5.5.90.0030.04720.06
5.5.80.0000.04320.06
5.5.70.0030.04019.97
5.5.60.0030.06019.96
5.5.50.0070.06019.96
5.5.40.0100.03020.09
5.5.30.0030.04020.11
5.5.20.0000.04020.04
5.5.10.0100.05720.00
5.5.00.0100.07720.03
5.4.450.0000.09019.45
5.4.440.0070.04319.44
5.4.430.0030.08719.26
5.4.420.0070.08019.46
5.4.410.0070.06018.98
5.4.400.0000.04318.79
5.4.390.0100.04718.96
5.4.380.0030.04019.03
5.4.370.0070.03719.04
5.4.360.0030.06719.07
5.4.350.0100.05019.05
5.4.340.0070.03719.05
5.4.320.0070.04718.94
5.4.310.0030.05719.09
5.4.300.0070.04319.22
5.4.290.0070.04319.22
5.4.280.0130.07018.97
5.4.270.0070.03718.97
5.4.260.0030.04319.02
5.4.250.0030.04019.01
5.4.240.0030.05719.18
5.4.230.0130.05319.08
5.4.220.0000.04319.02
5.4.210.0030.05018.96
5.4.200.0000.05018.78
5.4.190.0130.02719.04
5.4.180.0070.03019.05
5.4.170.0030.07718.80
5.4.160.0000.08018.92
5.4.150.0070.07718.94
5.4.140.0100.07016.39
5.4.130.0030.06316.34
5.4.120.0030.06316.27
5.4.110.0070.07716.28
5.4.100.0070.07716.36
5.4.90.0000.07716.29
5.4.80.0070.07316.43
5.4.70.0170.06716.48
5.4.60.0070.08016.39
5.4.50.0070.07316.33
5.4.40.0070.05016.39
5.4.30.0100.05716.33
5.4.20.0130.06716.17
5.4.10.0100.04316.28
5.4.00.0170.06315.68
5.3.290.0030.04014.66
5.3.280.0100.03714.43
5.3.270.0100.05014.47
5.3.260.0130.06714.59
5.3.250.0130.07014.50
5.3.240.0130.06714.57
5.3.230.0030.08314.43
5.3.220.0100.07314.53
5.3.210.0100.08314.52
5.3.200.0100.06714.56
5.3.190.0130.05014.58
5.3.180.0070.07314.43
5.3.170.0000.08014.43
5.3.160.0100.07314.57
5.3.150.0100.07014.43
5.3.140.0130.05014.55
5.3.130.0030.08314.54
5.3.120.0030.08014.55
5.3.110.0100.07714.42
5.3.100.0070.08314.03
5.3.90.0130.07014.02
5.3.80.0030.07314.00
5.3.70.0100.06713.96
5.3.60.0070.06713.99
5.3.50.0170.06713.73
5.3.40.0030.08013.95
5.3.30.0130.06713.78
5.3.20.0130.05713.68
5.3.10.0070.06713.62
5.3.00.0000.08013.65
5.2.170.0070.06310.95
5.2.160.0100.06011.23
5.2.150.0030.06711.18
5.2.140.0030.04711.14
5.2.130.0070.05311.15
5.2.120.0030.05310.96
5.2.110.0000.04310.90
5.2.100.0030.06310.92
5.2.90.0000.06711.11
5.2.80.0130.04710.94
5.2.70.0030.06011.14
5.2.60.0100.05311.01
5.2.50.0030.06311.02
5.2.40.0000.06011.04
5.2.30.0030.06310.78
5.2.20.0030.06011.04
5.2.10.0070.05710.82
5.2.00.0100.05310.79
5.1.60.0030.05010.01
5.1.50.0070.04710.07
5.1.40.0030.0579.98
5.1.30.0070.05310.41
5.1.20.0100.05010.47
5.1.10.0070.05010.09
5.1.00.0100.0479.98
5.0.50.0100.0409.98
5.0.40.0070.0409.98
5.0.30.0000.0679.98
5.0.20.0070.0379.98
5.0.10.0000.0339.98
5.0.00.0070.0609.98
4.4.90.0070.0339.98
4.4.80.0000.0379.98
4.4.70.0030.0409.98
4.4.60.0000.0379.98
4.4.50.0000.0379.98
4.4.40.0030.0539.98
4.4.30.0030.0339.98
4.4.20.0000.0339.98
4.4.10.0030.0179.98
4.4.00.0030.0579.98
4.3.110.0000.0409.98
4.3.100.0000.0379.98
4.3.90.0070.0209.98
4.3.80.0000.0439.98
4.3.70.0070.0309.98
4.3.60.0030.0339.98
4.3.50.0100.0239.98
4.3.40.0070.0409.98
4.3.30.0030.0179.98
4.3.20.0030.0239.98
4.3.10.0030.0179.98
4.3.00.0030.0239.98

preferences:
56.46 ms | 401 KiB | 5 Q