3v4l.org

run code in 300+ PHP versions simultaneously
<?php $intj = 5; $arrformfields[$intj][3] = 'ok'; $arrformfields[$intj][18] = 'ok'; ${$arrformfields[$intj][3]} = '1990'; ${$arrformfields[$intj][18]} = 4; $value = '1991;Y'; $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 && ${$arrformfields[$intj][3]} > $intyearstart)) OR ${$arrformfields[$intj][3]} < $intyearstart && ${$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 { echo ${$arrformfields[$intj][3]}; echo "Ok\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.0120.00316.63
8.3.50.0140.00617.43
8.3.40.0140.00718.88
8.3.30.0090.00618.79
8.3.20.0080.00818.70
8.3.10.0040.00420.61
8.3.00.0090.00019.50
8.2.180.0090.00916.75
8.2.170.0100.00722.96
8.2.160.0100.00320.39
8.2.150.0080.00024.18
8.2.140.0150.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00519.48
8.2.110.0080.00321.18
8.2.100.0090.00317.84
8.2.90.0050.00519.26
8.2.80.0000.00817.90
8.2.70.0050.00317.62
8.2.60.0030.00918.05
8.2.50.0080.00018.07
8.2.40.0040.00418.34
8.2.30.0070.00018.10
8.2.20.0040.00417.82
8.2.10.0000.00817.84
8.2.00.0080.00017.85
8.1.280.0130.00325.92
8.1.270.0100.00324.66
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0070.01020.91
8.1.230.0040.00720.90
8.1.220.0040.00417.89
8.1.210.0040.00418.78
8.1.200.0000.01017.48
8.1.190.0050.00317.53
8.1.180.0060.00318.10
8.1.170.0030.00518.73
8.1.160.0000.00718.92
8.1.150.0000.00818.80
8.1.140.0040.00417.56
8.1.130.0050.00217.92
8.1.120.0000.00717.64
8.1.110.0050.00217.62
8.1.100.0040.00417.61
8.1.90.0040.00417.50
8.1.80.0030.00517.48
8.1.70.0070.00017.66
8.1.60.0040.00417.68
8.1.50.0060.00317.52
8.1.40.0040.00417.64
8.1.30.0060.00317.65
8.1.20.0000.00717.62
8.1.10.0000.00817.53
8.1.00.0000.00817.67
8.0.300.0000.00719.89
8.0.290.0000.00816.88
8.0.280.0000.00718.53
8.0.270.0070.00017.25
8.0.260.0000.00716.88
8.0.250.0050.00317.15
8.0.240.0000.00717.10
8.0.230.0000.00717.00
8.0.220.0040.00417.08
8.0.210.0030.00317.02
8.0.200.0040.00417.04
8.0.190.0040.00416.95
8.0.180.0000.00717.05
8.0.170.0000.00817.03
8.0.160.0000.00717.02
8.0.150.0040.00416.97
8.0.140.0000.00816.84
8.0.130.0030.00313.32
8.0.120.0030.00516.91
8.0.110.0030.00316.84
8.0.100.0040.00417.02
8.0.90.0080.00017.04
8.0.80.0040.01116.94
8.0.70.0070.00016.79
8.0.60.0040.00416.95
8.0.50.0040.00416.92
8.0.30.0140.01117.34
8.0.20.0110.00717.42
8.0.10.0070.00017.16
8.0.00.0090.01116.79
7.4.330.0000.00513.10
7.4.320.0000.00616.71
7.4.300.0030.00316.74
7.4.290.0030.00316.66
7.4.280.0030.00616.59
7.4.270.0000.00716.61
7.4.260.0050.00013.37
7.4.250.0000.00816.62
7.4.240.0000.00816.66
7.4.230.0000.00716.53
7.4.220.0100.01016.58
7.4.210.0070.00916.69
7.4.200.0050.00516.50
7.4.190.0080.00016.84
7.4.160.0070.01016.86
7.4.150.0100.00716.58
7.4.140.0110.00916.83
7.4.130.0120.00516.56
7.4.120.0080.00916.64
7.4.110.0130.00316.56
7.4.100.0070.01016.87
7.4.90.0090.00916.65
7.4.80.0090.00919.39
7.4.70.0060.01516.64
7.4.60.0190.00516.63
7.4.50.0030.00616.53
7.4.40.0000.01316.48
7.4.30.0180.00316.64
7.4.00.0120.00015.07
7.3.330.0030.00313.31
7.3.320.0040.00413.16
7.3.310.0000.00716.47
7.3.300.0000.00716.38
7.3.290.0110.00516.48
7.3.280.0110.00516.43
7.3.270.0090.00916.62
7.3.260.0120.00616.70
7.3.250.0110.00616.37
7.3.240.0100.01016.64
7.3.230.0140.00316.59
7.3.210.0130.00316.80
7.3.200.0100.01016.45
7.3.190.0060.01216.49
7.3.180.0030.01416.47
7.3.170.0100.00716.64
7.3.160.0120.00916.48
7.3.120.0070.01014.69
7.2.330.0090.01616.85
7.2.320.0070.01016.65
7.2.310.0120.00616.67
7.2.300.0060.01016.61
7.2.290.0090.01516.87
7.2.00.0000.01119.36
7.1.100.0100.01416.37
7.1.70.0000.00917.28
7.1.60.0090.01519.40
7.1.50.0090.00317.18
7.1.00.0070.06022.54
7.0.200.0140.00415.00
7.0.140.0070.07021.97
7.0.120.0030.07322.14
7.0.80.0430.08019.91
7.0.70.0470.06720.00
7.0.60.0600.07719.98
7.0.50.0400.06020.24
7.0.40.0070.05020.04
7.0.30.0170.07020.09
7.0.20.0170.07720.15
7.0.10.0070.04719.95
7.0.00.0100.08320.16
5.6.230.0130.08020.63
5.6.220.0100.08020.65
5.6.210.0030.07020.78
5.6.200.0030.05320.98
5.6.190.0130.08020.96
5.6.180.0030.04721.10
5.6.170.0030.09321.05
5.6.160.0170.06021.09
5.6.150.0130.07020.89
5.6.140.0070.08321.02
5.6.130.0170.07721.14
5.6.120.0030.08321.01
5.6.110.0070.08021.02
5.6.100.0200.07720.93
5.6.90.0070.06021.06
5.6.80.0100.07020.35
5.6.70.0070.05320.34
5.6.60.0070.04020.39
5.6.50.0100.04720.49
5.6.40.0070.05020.36
5.6.30.0130.06320.40
5.6.20.0130.03720.47
5.6.10.0070.08020.47
5.6.00.0070.08720.41
5.5.370.0000.09020.46
5.5.360.0070.08720.54
5.5.350.0070.08020.38
5.5.340.0070.07020.94
5.5.330.0170.05720.74
5.5.320.0130.07720.78
5.5.310.0100.08020.91
5.5.300.0030.04020.77
5.5.290.0070.07720.88
5.5.280.0070.08020.93
5.5.270.0030.06320.78
5.5.260.0030.08020.90
5.5.250.0170.03720.68
5.5.240.0200.04720.22
5.5.230.0130.03320.22
5.5.220.0000.06320.18
5.5.210.0100.06720.32
5.5.200.0000.08320.19
5.5.190.0070.07020.23
5.5.180.0130.05020.16
5.5.160.0100.06020.20
5.5.150.0030.05020.16
5.5.140.0000.06720.22
5.5.130.0030.05020.09
5.5.120.0070.06720.00
5.5.110.0030.06020.27
5.5.100.0030.05020.09
5.5.90.0070.07720.08
5.5.80.0130.07320.11
5.5.70.0130.07319.95
5.5.60.0030.04319.94
5.5.50.0030.07020.12
5.5.40.0000.08320.06
5.5.30.0030.08020.05
5.5.20.0070.08320.10
5.5.10.0130.07020.04
5.5.00.0070.05320.07
5.4.450.0070.08719.36
5.4.440.0130.07319.11
5.4.430.0170.07019.43
5.4.420.0100.07019.13
5.4.410.0070.04719.25
5.4.400.0100.06019.06
5.4.390.0000.05019.03
5.4.380.0100.07319.22
5.4.370.0170.05719.04
5.4.360.0030.04719.02
5.4.350.0100.04019.23
5.4.340.0030.04718.91
5.4.320.0070.05719.11
5.4.310.0100.06018.78
5.4.300.0070.06719.14
5.4.290.0030.06019.00
5.4.280.0070.06718.78
5.4.270.0200.06718.80
5.4.260.0130.07319.02
5.4.250.0070.06318.96
5.4.240.0030.04319.11
5.4.230.0070.07018.77
5.4.220.0070.04318.93
5.4.210.0070.06719.14
5.4.200.0070.07718.97
5.4.190.0070.04318.96
5.4.180.0030.05718.96
5.4.170.0100.07319.11
5.4.160.0130.06318.94
5.4.150.0070.06319.01
5.4.140.0100.04316.20
5.4.130.0100.06716.38
5.4.120.0100.08716.41
5.4.110.0030.07016.37
5.4.100.0100.04316.26
5.4.90.0030.07716.38
5.4.80.0030.05316.30
5.4.70.0000.07016.46
5.4.60.0100.06716.31
5.4.50.0170.05316.39
5.4.40.0030.07316.26
5.4.30.0070.06016.23
5.4.20.0070.04016.27
5.4.10.0000.04016.31
5.4.00.0030.05715.73
5.3.290.0070.07314.55
5.3.280.0030.07714.61
5.3.270.0030.07314.48
5.3.260.0070.05014.49
5.3.250.0070.06714.48
5.3.240.0030.04314.49
5.3.230.0000.04714.63
5.3.220.0000.05314.53
5.3.210.0170.04714.43
5.3.200.0200.05714.50
5.3.190.0030.07314.45
5.3.180.0070.06314.55
5.3.170.0130.07014.40
5.3.160.0170.07014.54
5.3.150.0070.07014.57
5.3.140.0070.05014.54
5.3.130.0100.04314.39
5.3.120.0000.04714.56
5.3.110.0030.05714.54
5.3.100.0100.05314.04
5.3.90.0030.07713.91
5.3.80.0100.06014.02
5.3.70.0100.07014.03
5.3.60.0070.04314.01
5.3.50.0030.07713.91
5.3.40.0070.06013.95
5.3.30.0070.05313.88
5.3.20.0100.04713.68
5.3.10.0000.07313.54
5.3.00.0030.07713.61
5.2.170.0070.04311.21
5.2.160.0000.03711.12
5.2.150.0070.06310.99
5.2.140.0130.04711.09
5.2.130.0030.03310.96
5.2.120.0000.05711.20
5.2.110.0000.05311.16
5.2.100.0100.03311.08
5.2.90.0130.04710.94
5.2.80.0030.04710.96
5.2.70.0130.03311.11
5.2.60.0030.03011.00
5.2.50.0000.06010.96
5.2.40.0170.02711.07
5.2.30.0070.04010.83
5.2.20.0100.04010.95
5.2.10.0030.03710.97
5.2.00.0030.03010.81
5.1.60.0100.03710.01
5.1.50.0070.05010.01
5.1.40.0000.0479.83
5.1.30.0000.05710.44
5.1.20.0070.05010.36
5.1.10.0130.04310.12
5.1.00.0000.03310.10
5.0.50.0000.0378.56
5.0.40.0030.0238.52
5.0.30.0100.0478.14
5.0.20.0000.0338.07
5.0.10.0070.0238.20
5.0.00.0000.0378.27
4.4.90.0000.0207.23
4.4.80.0000.0377.23
4.4.70.0030.0337.23
4.4.60.0000.0407.23
4.4.50.0000.0337.23
4.4.40.0030.0507.23
4.4.30.0030.0207.23
4.4.20.0030.0337.23
4.4.10.0030.0207.23
4.4.00.0100.0477.23
4.3.110.0070.0337.23
4.3.100.0030.0377.23
4.3.90.0070.0307.23
4.3.80.0030.0437.23
4.3.70.0000.0177.23
4.3.60.0000.0237.23
4.3.50.0000.0277.23
4.3.40.0030.0577.23
4.3.30.0000.0177.23
4.3.20.0000.0237.23
4.3.10.0000.0407.23
4.3.00.0000.0377.23

preferences:
38.25 ms | 401 KiB | 5 Q