3v4l.org

run code in 300+ PHP versions simultaneously
<?php $intj = 5; $arrformfields[$intj][3] = 'ok'; $arrformfields[$intj][18] = 'ok2'; ${$arrformfields[$intj][3]} = '1990'; ${$arrformfields[$intj][18]} = 4; $value = ';'; $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) // On va définir l'année de départ et de fin. { if ($arrvalidrules[$key]!='') // On a définit une valeur dans la règle. { if (is_numeric($arrvalidrules[$key])) // Valeur numérique fixe. { ${$label} = intval($arrvalidrules[$key]); } else if (strpos($arrvalidrules[$key], 'Y') === 0) // Valeur selon l'année actuelle. { ${$label} = date('Y'); if (($intsignpos = strpos($arrvalidrules[$key], '+')) !== false) // On vérifie si on souhaite faire une adition. { ${$label} += intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } else if (($intsignpos = strpos($arrvalidrules[$key], '-')) !== false) // On vérifie si on souhaite faire une soustraction. { ${$label} -= intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } } else // On a saisit une valeur erroné (du texte) on définit la valeur comme par défaut. { ${$label} = ($key == 0 ? str_pad(0, ${$arrformfields[$intj][18]}, '0') : null); } } else // Définition de la valeur par défaut (annéeDeb = 0, annéeFin = null). { ${$label} = ($key == 0 ? str_pad(0, ${$arrformfields[$intj][18]}, '0') : null); } } if ($intyearend !== null) { if ( (($intyearstart > $intyearend) && (${$arrformfields[$intj][3]} < $intyearend OR ${$arrformfields[$intj][3]} > $intyearstart)) OR ${$arrformfields[$intj][3]} < $intyearstart OR ${$arrformfields[$intj][3]} > $intyearend ) { if ($intyearstart > $intyearend) { // L'année de début > à la fin, on change les valeurs. $intswitch = $intyearstart; $intyearstart = $intyearend; $intyearend = $intswitch; } //"Le champ '".$arrformfields[$intj][1]."' est invalide, la valeur doit être comprise entre ".$intyearstart." et ".$intyearend." !<br />"; echo "FAUX\n\n"; } } else if (${$arrformfields[$intj][3]} < $intyearstart) { //"Le champ '".$arrformfields[$intj][1]."' est invalide, la valeur doit être comprise entre ".$intyearstart." et ".$intyearend." !<br />"; echo "FAUX\n\n"; } } 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.60.0080.00816.88
8.3.50.0100.00722.05
8.3.40.0090.00618.71
8.3.30.0040.01119.07
8.3.20.0080.00020.10
8.3.10.0040.00423.63
8.3.00.0050.00319.00
8.2.180.0120.00616.63
8.2.170.0090.00622.96
8.2.160.0100.00320.52
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0000.00820.07
8.2.110.0090.00022.20
8.2.100.0040.00717.91
8.2.90.0040.00419.41
8.2.80.0080.00017.97
8.2.70.0080.00017.48
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0050.00321.14
8.2.30.0000.00818.33
8.2.20.0020.00517.86
8.2.10.0040.00418.17
8.2.00.0080.00017.78
8.1.280.0090.00525.92
8.1.270.0050.00323.79
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0000.00924.02
8.1.230.0040.00819.21
8.1.220.0080.00017.79
8.1.210.0030.00518.77
8.1.200.0060.00617.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0050.00318.46
8.1.160.0070.00022.03
8.1.150.0070.00018.62
8.1.140.0000.00717.43
8.1.130.0040.00417.41
8.1.120.0000.00717.40
8.1.110.0000.00817.51
8.1.100.0000.00717.49
8.1.90.0030.00517.46
8.1.80.0040.00417.49
8.1.70.0000.00817.46
8.1.60.0040.00417.60
8.1.50.0030.00517.59
8.1.40.0040.00417.50
8.1.30.0040.00417.71
8.1.20.0100.00017.50
8.1.10.0000.00817.63
8.1.00.0040.00817.52
8.0.300.0000.00818.77
8.0.290.0030.00617.04
8.0.280.0040.00418.38
8.0.270.0050.00217.34
8.0.260.0000.00716.76
8.0.250.0030.00316.87
8.0.240.0000.00816.95
8.0.230.0070.00016.98
8.0.220.0040.00416.91
8.0.210.0070.00016.96
8.0.200.0000.00616.95
8.0.190.0050.00516.88
8.0.180.0040.00416.91
8.0.170.0000.00716.99
8.0.160.0030.00316.95
8.0.150.0050.00316.93
8.0.140.0070.00016.75
8.0.130.0000.00713.33
8.0.120.0060.00316.89
8.0.110.0000.00716.99
8.0.100.0040.00416.96
8.0.90.0040.00416.76
8.0.80.0070.01016.91
8.0.70.0030.00516.75
8.0.60.0000.00716.93
8.0.50.0080.00016.91
8.0.30.0150.01017.15
8.0.20.0140.00517.44
8.0.10.0040.00416.91
8.0.00.0110.01116.77
7.4.330.0030.00315.00
7.4.320.0030.00316.54
7.4.300.0030.00316.54
7.4.290.0030.00316.64
7.4.280.0000.00816.64
7.4.270.0000.00716.55
7.4.260.0040.00416.54
7.4.250.0070.00016.59
7.4.240.0040.00316.47
7.4.230.0040.00416.70
7.4.220.0110.00816.43
7.4.210.0050.01016.48
7.4.200.0000.00716.38
7.4.190.0030.00316.44
7.4.160.0080.00816.64
7.4.150.0140.00417.40
7.4.140.0080.01117.86
7.4.130.0090.00816.73
7.4.120.0080.00916.60
7.4.110.0100.00716.54
7.4.100.0140.00316.68
7.4.90.0130.00616.70
7.4.80.0090.00919.39
7.4.70.0140.00416.74
7.4.60.0110.01116.43
7.4.50.0030.00316.53
7.4.40.0120.00616.34
7.4.30.0060.01216.50
7.4.00.0060.00915.08
7.3.330.0050.00013.12
7.3.320.0050.00013.09
7.3.310.0070.00016.30
7.3.300.0030.00316.27
7.3.290.0130.00716.39
7.3.280.0070.01016.35
7.3.270.0030.01417.40
7.3.260.0000.01716.45
7.3.250.0100.00716.41
7.3.240.0060.01316.33
7.3.230.0070.01016.39
7.3.210.0130.00716.56
7.3.200.0040.01319.39
7.3.190.0130.00316.30
7.3.180.0130.00316.25
7.3.170.0150.00616.68
7.3.160.0000.01616.42
7.3.120.0090.00614.88
7.3.110.0110.00414.69
7.3.100.0000.01414.83
7.3.90.0070.00314.89
7.3.80.0090.00614.54
7.3.70.0060.00915.00
7.3.60.0060.00615.01
7.3.50.0070.00714.93
7.3.40.0030.00914.71
7.3.30.0060.00314.95
7.3.20.0040.01116.64
7.3.10.0110.00416.45
7.3.00.0090.00616.78
7.2.330.0130.00916.53
7.2.320.0100.01016.81
7.2.310.0060.01616.67
7.2.300.0030.01316.66
7.2.290.0070.01116.57
7.2.240.0090.00615.24
7.2.230.0090.00615.10
7.2.220.0140.00015.21
7.2.210.0000.01514.82
7.2.200.0100.00714.89
7.2.190.0060.01215.17
7.2.180.0170.00015.03
7.2.170.0040.01114.85
7.2.160.0130.00315.06
7.2.150.0100.00316.68
7.2.140.0070.01017.07
7.2.130.0000.01116.96
7.2.120.0060.00816.88
7.2.110.0080.00617.12
7.2.100.0070.00716.89
7.2.90.0040.00817.04
7.2.80.0030.01117.03
7.2.70.0090.00616.74
7.2.60.0070.01117.04
7.2.50.0030.00716.85
7.2.40.0070.01017.14
7.2.30.0030.01217.12
7.2.20.0030.00816.96
7.2.10.0040.00917.14
7.2.00.0070.00316.93
7.1.330.0040.01115.87
7.1.320.0070.00715.82
7.1.310.0040.00815.68
7.1.300.0070.01015.88
7.1.290.0030.00915.64
7.1.280.0040.01115.55
7.1.270.0080.00415.61
7.1.260.0030.00915.76
7.1.250.0030.01015.76
7.1.200.0000.00815.95
7.1.70.0000.01017.27
7.1.60.0070.01719.46
7.1.50.0030.01016.70
7.1.00.0000.08022.40
7.0.200.0040.01116.50
7.0.140.0030.07322.18
7.0.90.0130.07720.02
7.0.80.0030.04719.89
7.0.70.0070.05019.95
7.0.60.0130.07319.98
7.0.50.0100.07320.32
7.0.40.0100.08320.11
7.0.30.0000.09020.09
7.0.20.0070.08320.04
7.0.10.0100.03720.16
7.0.00.0030.08320.18
5.6.280.0000.07720.91
5.6.240.0100.07320.61
5.6.230.0100.07020.64
5.6.220.0130.05720.67
5.6.210.0100.07320.62
5.6.200.0000.07021.09
5.6.190.0070.05021.09
5.6.180.0070.08721.02
5.6.170.0200.07721.02
5.6.160.0100.07720.96
5.6.150.0130.07321.14
5.6.140.0030.05321.14
5.6.130.0130.06721.09
5.6.120.0100.08721.09
5.6.110.0030.08721.13
5.6.100.0100.08021.02
5.6.90.0100.08321.04
5.6.80.0100.08320.48
5.6.70.0070.07720.42
5.6.60.0100.08320.46
5.6.50.0030.08320.40
5.6.40.0070.06320.33
5.6.30.0030.05320.43
5.6.20.0070.04320.29
5.6.10.0070.04020.42
5.6.00.0230.06320.30
5.5.380.0070.04720.57
5.5.370.0030.04020.46
5.5.360.0100.07320.54
5.5.350.0100.08720.49
5.5.340.0100.07320.82
5.5.330.0100.04320.93
5.5.320.0200.07320.93
5.5.310.0070.06320.89
5.5.300.0030.05720.65
5.5.290.0170.07720.84
5.5.280.0070.09020.90
5.5.270.0170.04320.90
5.5.260.0200.07320.73
5.5.250.0030.05320.57
5.5.240.0130.04020.15
5.5.230.0100.06320.25
5.5.220.0030.07720.27
5.5.210.0070.04320.23
5.5.200.0070.08320.14
5.5.190.0070.08020.24
5.5.180.0030.07720.09
5.5.160.0000.07020.25
5.5.150.0130.07020.12
5.5.140.0170.04320.25
5.5.130.0070.04320.27
5.5.120.0070.08320.19
5.5.110.0170.07320.21
5.5.100.0070.08020.17
5.5.90.0070.08020.16
5.5.80.0130.05720.16
5.5.70.0070.07319.97
5.5.60.0100.08020.16
5.5.50.0070.04320.13
5.5.40.0030.08720.07
5.5.30.0030.04320.16
5.5.20.0100.08019.96
5.5.10.0170.07020.08
5.5.00.0170.07020.03
5.4.450.0100.04319.40
5.4.440.0030.09019.22
5.4.430.0070.04719.43
5.4.420.0170.07019.12
5.4.410.0030.04719.35
5.4.400.0100.07719.23
5.4.390.0070.08019.07
5.4.380.0100.07318.81
5.4.370.0000.08018.98
5.4.360.0070.07718.78
5.4.350.0070.06319.03
5.4.340.0130.07019.11
5.4.320.0100.07718.95
5.4.310.0000.08019.23
5.4.300.0200.03019.23
5.4.290.0070.07719.10
5.4.280.0070.07319.23
5.4.270.0070.03718.97
5.4.260.0070.08019.11
5.4.250.0070.05319.12
5.4.240.0070.07318.93
5.4.230.0100.07018.93
5.4.220.0100.07719.05
5.4.210.0130.07018.95
5.4.200.0030.07318.97
5.4.190.0130.06319.04
5.4.180.0200.06018.77
5.4.170.0100.07718.89
5.4.160.0000.08319.02
5.4.150.0070.07318.94
5.4.140.0130.02716.28
5.4.130.0030.04316.27
5.4.120.0030.07716.25
5.4.110.0070.06316.39
5.4.100.0000.04716.27
5.4.90.0030.07316.42
5.4.80.0170.05016.24
5.4.70.0030.04716.32
5.4.60.0100.04016.43
5.4.50.0030.04716.35
5.4.40.0130.06716.45
5.4.30.0030.07016.30
5.4.20.0170.06316.23
5.4.10.0100.06316.34
5.4.00.0130.04315.74
5.3.290.0100.07714.54
5.3.280.0030.07714.60
5.3.270.0070.07014.57
5.3.260.0130.03714.59
5.3.250.0130.07014.59
5.3.240.0130.06714.60
5.3.230.0100.06314.61
5.3.220.0130.07314.59
5.3.210.0030.05714.52
5.3.200.0030.05714.52
5.3.190.0070.04014.52
5.3.180.0200.06314.40
5.3.170.0030.07714.57
5.3.160.0130.03014.56
5.3.150.0070.07314.44
5.3.140.0100.03714.41
5.3.130.0100.05014.39
5.3.120.0100.07314.45
5.3.110.0100.07714.52
5.3.100.0030.08014.05
5.3.90.0100.03714.03
5.3.80.0200.06713.91
5.3.70.0070.07713.89
5.3.60.0030.04314.00
5.3.50.0070.06713.73
5.3.40.0070.06713.95
5.3.30.0100.07013.95
5.3.20.0070.07013.57
5.3.10.0030.07313.64
5.3.00.0030.06713.64
5.2.170.0070.06011.02
5.2.160.0070.03011.24
5.2.150.0070.05711.24
5.2.140.0030.03311.00
5.2.130.0100.04311.18
5.2.120.0000.05011.00
5.2.110.0030.06311.09
5.2.100.0130.05311.00
5.2.90.0030.06311.12
5.2.80.0030.04011.06
5.2.70.0130.05311.08
5.2.60.0000.06011.06
5.2.50.0000.06011.00
5.2.40.0170.04711.02
5.2.30.0070.05710.95
5.2.20.0070.05710.77
5.2.10.0070.05710.99
5.2.00.0030.06010.80
5.1.60.0070.04010.30
5.1.50.0070.03310.30
5.1.40.0030.05710.30
5.1.30.0070.04310.34
5.1.20.0030.05310.32
5.1.10.0030.04010.30
5.1.00.0030.05310.30
5.0.50.0000.04710.30
5.0.40.0130.03310.30
5.0.30.0000.06710.30
5.0.20.0030.04310.30
5.0.10.0070.03710.30
5.0.00.0100.06010.30
4.4.90.0030.04310.30
4.4.80.0030.03710.30
4.4.70.0000.04010.30
4.4.60.0000.03710.30
4.4.50.0000.03710.30
4.4.40.0100.04710.30
4.4.30.0000.03710.30
4.4.20.0070.03010.30
4.4.10.0000.04010.30
4.4.00.0000.05310.30
4.3.110.0070.02010.30
4.3.100.0070.03010.30
4.3.90.0070.03010.30
4.3.80.0030.05310.30
4.3.70.0070.03010.30
4.3.60.0070.03310.30
4.3.50.0000.03710.30
4.3.40.0070.04710.30
4.3.30.0030.03710.30
4.3.20.0000.03310.30
4.3.10.0000.03710.30
4.3.00.0030.02310.30

preferences:
45.16 ms | 401 KiB | 5 Q