3v4l.org

run code in 300+ PHP versions simultaneously
<?php $intj = 5; $arrformfields[$intj][3] = 'ok'; $arrformfields[$intj][18] = 'ok2'; ${$arrformfields[$intj][3]} = '1992'; ${$arrformfields[$intj][18]} = 4; $value = '1995;'; $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.0110.00716.63
8.3.50.0100.00818.26
8.3.40.0120.00318.79
8.3.30.0140.00018.66
8.3.20.0030.00618.90
8.3.10.0030.00620.51
8.3.00.0040.00419.38
8.2.180.0170.00316.50
8.2.170.0140.00722.96
8.2.160.0040.01118.71
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0030.00619.95
8.2.110.0070.01422.11
8.2.100.0030.00917.78
8.2.90.0060.00317.88
8.2.80.0040.00418.73
8.2.70.0050.00517.92
8.2.60.0050.00318.16
8.2.50.0040.00418.10
8.2.40.0000.00819.10
8.2.30.0050.00319.28
8.2.20.0090.00017.69
8.2.10.0040.00417.79
8.2.00.0090.00017.75
8.1.280.0070.01025.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00721.93
8.1.230.0080.00417.71
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0070.00317.35
8.1.190.0060.00317.23
8.1.180.0030.00618.10
8.1.170.0000.00818.72
8.1.160.0040.00419.01
8.1.150.0040.00418.71
8.1.140.0000.00717.55
8.1.130.0030.00317.77
8.1.120.0040.00717.53
8.1.110.0080.00017.48
8.1.100.0080.00017.55
8.1.90.0000.00817.41
8.1.80.0000.00717.38
8.1.70.0070.00017.43
8.1.60.0000.01117.50
8.1.50.0000.00717.40
8.1.40.0040.00417.45
8.1.30.0000.00917.70
8.1.20.0040.00417.59
8.1.10.0050.00317.58
8.1.00.0030.00517.55
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0000.00818.47
8.0.270.0070.00017.21
8.0.260.0000.00616.85
8.0.250.0070.00016.98
8.0.240.0070.00017.03
8.0.230.0040.00416.95
8.0.220.0030.00316.94
8.0.210.0030.00316.96
8.0.200.0040.00416.94
8.0.190.0000.00717.03
8.0.180.0040.00416.95
8.0.170.0060.00316.77
8.0.160.0050.00316.97
8.0.150.0040.00416.96
8.0.140.0000.00716.77
8.0.130.0030.00313.39
8.0.120.0000.00916.94
8.0.110.0030.00616.79
8.0.100.0070.00016.98
8.0.90.0040.00416.92
8.0.80.0040.01116.96
8.0.70.0000.00716.90
8.0.60.0070.00016.80
8.0.50.0040.00416.98
8.0.30.0030.01417.39
8.0.20.0090.00917.14
8.0.10.0000.00716.91
8.0.00.0120.00916.94
7.4.330.0050.00012.94
7.4.320.0000.00716.68
7.4.300.0030.00616.55
7.4.290.0030.00316.67
7.4.280.0040.00416.69
7.4.270.0000.00716.68
7.4.260.0050.00013.20
7.4.250.0040.00416.57
7.4.240.0000.00716.63
7.4.230.0050.00316.62
7.4.220.0060.01516.38
7.4.210.0110.00916.64
7.4.200.0030.00316.42
7.4.190.0070.00016.75
7.4.160.0040.01216.77
7.4.150.0080.01116.46
7.4.140.0130.01016.49
7.4.130.0100.01316.55
7.4.120.0140.00316.38
7.4.110.0100.00716.69
7.4.100.0030.01416.66
7.4.90.0100.00716.63
7.4.80.0100.01016.64
7.4.70.0130.00316.45
7.4.60.0160.00616.34
7.4.50.0000.00516.30
7.4.40.0070.01116.32
7.4.30.0100.00716.63
7.4.00.0000.01514.86
7.3.330.0030.00313.12
7.3.320.0050.00013.24
7.3.310.0070.00016.41
7.3.300.0070.00016.38
7.3.290.0070.01016.35
7.3.280.0100.00516.40
7.3.270.0000.01716.46
7.3.260.0090.00916.55
7.3.250.0030.01516.56
7.3.240.0070.01416.38
7.3.230.0080.00816.45
7.3.210.0140.00916.43
7.3.200.0050.00619.39
7.3.190.0140.00316.53
7.3.180.0040.01216.41
7.3.170.0130.00316.62
7.3.160.0090.00616.48
7.3.120.0040.00815.07
7.2.330.0060.01216.54
7.2.320.0030.02116.75
7.2.310.0130.01016.89
7.2.300.0090.01216.72
7.2.290.0090.00816.85
7.2.00.0040.00819.60
7.1.100.0030.00917.85
7.1.70.0110.00017.09
7.1.60.0100.01419.31
7.1.50.0100.01316.82
7.1.00.0030.06722.51
7.0.200.0030.00616.83
7.0.140.0070.07022.08
7.0.120.0070.07322.05
7.0.80.0630.08019.95
7.0.70.0430.07319.96
7.0.60.0670.08019.95
7.0.50.0570.08320.38
7.0.40.0070.08320.15
7.0.30.0070.07720.03
7.0.20.0070.08320.04
7.0.10.0070.07320.14
7.0.00.0070.04720.07
5.6.280.0000.07720.93
5.6.230.0030.08720.51
5.6.220.0070.03720.57
5.6.210.0100.07320.48
5.6.200.0000.08721.09
5.6.190.0130.08020.93
5.6.180.0000.05321.00
5.6.170.0030.05020.97
5.6.160.0100.08021.12
5.6.150.0070.08321.05
5.6.140.0000.08721.11
5.6.130.0030.08321.12
5.6.120.0130.07021.11
5.6.110.0130.07020.99
5.6.100.0030.04321.04
5.6.90.0030.04320.94
5.6.80.0070.04020.34
5.6.70.0070.07320.40
5.6.60.0070.03720.42
5.6.50.0070.04320.32
5.6.40.0100.06720.36
5.6.30.0130.06320.33
5.6.20.0030.06020.41
5.6.10.0030.04020.53
5.6.00.0100.03320.43
5.5.370.0100.07320.46
5.5.360.0030.08320.49
5.5.350.0130.07020.48
5.5.340.0000.09320.81
5.5.330.0170.07720.93
5.5.320.0100.06720.91
5.5.310.0030.04720.83
5.5.300.0100.08720.89
5.5.290.0070.05720.90
5.5.280.0070.08720.78
5.5.270.0200.07020.92
5.5.260.0100.03320.87
5.5.250.0030.03720.75
5.5.240.0000.04020.13
5.5.230.0030.04020.26
5.5.220.0030.05320.12
5.5.210.0030.04020.25
5.5.200.0100.07720.29
5.5.190.0030.03320.12
5.5.180.0030.04020.27
5.5.160.0000.03720.19
5.5.150.0030.05720.21
5.5.140.0030.04020.28
5.5.130.0130.04020.27
5.5.120.0030.03320.27
5.5.110.0000.05720.09
5.5.100.0000.05320.08
5.5.90.0000.03720.14
5.5.80.0100.02720.13
5.5.70.0070.06720.07
5.5.60.0030.03320.11
5.5.50.0070.03020.07
5.5.40.0130.06320.15
5.5.30.0100.02720.16
5.5.20.0000.04320.06
5.5.10.0070.03719.93
5.5.00.0100.03320.12
5.4.450.0070.08019.45
5.4.440.0030.05019.45
5.4.430.0130.04719.35
5.4.420.0000.04319.41
5.4.410.0000.04719.29
5.4.400.0030.04718.96
5.4.390.0000.03719.07
5.4.380.0070.03719.23
5.4.370.0000.04019.07
5.4.360.0070.04719.04
5.4.350.0070.07018.93
5.4.340.0000.03719.03
5.4.320.0030.03319.23
5.4.310.0000.04019.14
5.4.300.0000.04018.98
5.4.290.0130.03319.14
5.4.280.0000.04318.98
5.4.270.0000.03718.81
5.4.260.0000.04019.04
5.4.250.0030.04018.80
5.4.240.0030.05319.05
5.4.230.0100.05719.02
5.4.220.0070.04318.94
5.4.210.0070.03019.04
5.4.200.0030.03718.96
5.4.190.0030.05319.19
5.4.180.0030.03719.03
5.4.170.0030.03719.11
5.4.160.0100.03318.95
5.4.150.0070.05719.02
5.4.140.0030.04716.29
5.4.130.0030.03716.29
5.4.120.0100.04316.33
5.4.110.0030.03716.42
5.4.100.0030.07716.27
5.4.90.0070.07316.23
5.4.80.0000.05316.40
5.4.70.0070.03316.39
5.4.60.0070.03316.28
5.4.50.0030.07716.23
5.4.40.0130.06316.34
5.4.30.0130.06016.39
5.4.20.0030.08016.32
5.4.10.0000.04716.18
5.4.00.0130.03015.51
5.3.290.0030.06014.64
5.3.280.0100.03314.57
5.3.270.0000.04014.64
5.3.260.0030.04014.51
5.3.250.0000.06314.50
5.3.240.0030.04314.57
5.3.230.0030.08014.48
5.3.220.0070.03014.45
5.3.210.0000.04014.60
5.3.200.0070.03714.50
5.3.190.0100.07014.44
5.3.180.0070.07314.52
5.3.170.0100.05014.44
5.3.160.0100.03014.58
5.3.150.0130.06014.57
5.3.140.0030.06714.43
5.3.130.0070.04714.43
5.3.120.0070.07714.56
5.3.110.0070.06714.43
5.3.100.0070.07314.07
5.3.90.0000.07014.05
5.3.80.0070.04013.97
5.3.70.0130.07013.97
5.3.60.0030.04313.78
5.3.50.0030.05013.94
5.3.40.0000.06313.74
5.3.30.0100.04313.92
5.3.20.0100.07313.47
5.3.10.0200.05713.54
5.3.00.0100.06713.59
5.2.170.0070.06311.12
5.2.160.0000.05011.20
5.2.150.0070.06311.02
5.2.140.0100.07011.13
5.2.130.0070.06310.99
5.2.120.0130.05311.00
5.2.110.0170.05011.12
5.2.100.0030.05311.15
5.2.90.0070.06311.08
5.2.80.0000.04711.06
5.2.70.0100.06011.18
5.2.60.0070.06011.07
5.2.50.0030.06711.04
5.2.40.0030.06310.98
5.2.30.0070.04310.98
5.2.20.0030.06310.94
5.2.10.0170.05310.78
5.2.00.0030.06310.85
5.1.60.0070.03710.02
5.1.50.0070.05010.03
5.1.40.0070.04710.11
5.1.30.0000.04710.25
5.1.20.0030.05710.39
5.1.10.0070.05310.18
5.1.00.0070.03710.20
5.0.50.0030.0478.42
5.0.40.0130.0378.49
5.0.30.0070.0638.36
5.0.20.0030.0378.07
5.0.10.0070.0308.10
5.0.00.0000.0608.03
4.4.90.0000.0336.96
4.4.80.0000.0376.96
4.4.70.0030.0276.96
4.4.60.0000.0376.96
4.4.50.0000.0376.96
4.4.40.0000.0406.96
4.4.30.0000.0406.96
4.4.20.0000.0376.96
4.4.10.0100.0206.96
4.4.00.0000.0576.96
4.3.110.0100.0306.96
4.3.100.0030.0336.96
4.3.90.0100.0306.96
4.3.80.0030.0536.96
4.3.70.0070.0306.96
4.3.60.0030.0306.96
4.3.50.0000.0306.96
4.3.40.0030.0506.96
4.3.30.0000.0376.96
4.3.20.0030.0376.96
4.3.10.0070.0336.96
4.3.00.0030.0336.96

preferences:
53.44 ms | 401 KiB | 5 Q