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 = ';1950'; $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.40.0040.01118.83
8.3.30.0120.00418.67
8.3.20.0040.00418.73
8.3.10.0040.00421.09
8.3.00.0090.00023.66
8.2.170.0150.00622.96
8.2.160.0090.00920.33
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00021.07
8.2.110.0070.00320.35
8.2.100.0090.00317.72
8.2.90.0060.00319.34
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0040.00418.17
8.2.30.0050.00219.38
8.2.20.0040.00417.80
8.2.10.0040.00417.83
8.2.00.0040.00417.64
8.1.270.0000.00823.99
8.1.260.0070.00026.35
8.1.250.0090.00028.09
8.1.240.0090.00022.58
8.1.230.0090.00321.03
8.1.220.0080.00018.77
8.1.210.0080.00018.96
8.1.200.0030.00617.35
8.1.190.0000.00717.51
8.1.180.0030.00718.10
8.1.170.0000.00818.71
8.1.160.0040.00418.79
8.1.150.0090.00318.68
8.1.140.0000.00717.48
8.1.130.0030.00317.86
8.1.120.0000.00717.52
8.1.110.0000.00717.53
8.1.100.0000.00717.52
8.1.90.0100.00017.44
8.1.80.0000.00717.50
8.1.70.0030.00317.36
8.1.60.0090.00017.66
8.1.50.0000.00817.53
8.1.40.0040.00417.43
8.1.30.0040.00417.71
8.1.20.0050.00317.61
8.1.10.0000.00817.65
8.1.00.0040.00717.43
8.0.300.0070.00019.98
8.0.290.0040.00417.18
8.0.280.0050.00318.39
8.0.270.0070.00017.29
8.0.260.0030.00316.74
8.0.250.0050.00317.05
8.0.240.0070.00316.86
8.0.230.0000.00716.82
8.0.220.0030.00316.84
8.0.210.0030.00316.86
8.0.200.0000.00616.93
8.0.190.0080.00016.86
8.0.180.0040.00416.95
8.0.170.0030.00516.83
8.0.160.0040.00316.82
8.0.150.0040.00416.90
8.0.140.0040.00416.81
8.0.130.0030.00313.36
8.0.120.0040.00416.94
8.0.110.0000.00716.99
8.0.100.0040.00416.79
8.0.90.0040.00416.71
8.0.80.0080.00816.98
8.0.70.0030.00517.00
8.0.60.0040.00416.90
8.0.50.0000.00717.04
8.0.30.0090.01217.07
8.0.20.0100.01217.45
8.0.10.0030.00516.92
8.0.00.0060.01516.80
7.4.330.0000.00616.79
7.4.320.0060.00016.68
7.4.300.0060.00016.67
7.4.290.0000.00716.54
7.4.280.0000.00716.51
7.4.270.0030.00316.60
7.4.260.0060.00013.26
7.4.250.0000.00816.43
7.4.240.0070.00016.59
7.4.230.0070.00016.74
7.4.220.0130.00316.36
7.4.210.0090.00716.53
7.4.200.0030.00316.73
7.4.190.0070.00016.48
7.4.160.0100.00716.61
7.4.150.0380.02617.40
7.4.140.0100.00717.86
7.4.130.0090.00916.60
7.4.120.0120.00916.58
7.4.110.0070.01016.43
7.4.100.0090.00916.40
7.4.90.0090.00916.63
7.4.80.0100.00619.39
7.4.70.0060.00916.54
7.4.60.0000.01616.41
7.4.50.0000.00816.61
7.4.40.0070.00422.77
7.4.30.0030.01416.59
7.4.00.0090.00915.13
7.3.330.0000.00513.15
7.3.320.0000.00513.10
7.3.310.0040.00416.36
7.3.300.0000.00716.25
7.3.290.0040.01116.34
7.3.280.0040.01116.36
7.3.270.0100.00717.40
7.3.260.0130.00718.24
7.3.250.0120.00516.55
7.3.240.0090.00616.68
7.3.230.0110.00616.54
7.3.210.0100.00716.39
7.3.200.0060.01019.39
7.3.190.0120.00616.70
7.3.180.0130.00316.45
7.3.170.0030.01716.36
7.3.160.0060.00916.57
7.3.120.0080.01014.99
7.3.110.0040.00914.88
7.3.100.0050.00914.86
7.3.90.0060.00615.01
7.3.80.0070.00814.81
7.3.70.0060.00614.90
7.3.60.0060.00514.77
7.3.50.0060.00514.93
7.3.40.0030.01014.84
7.3.30.0040.00714.99
7.3.20.0110.00516.73
7.3.10.0090.00616.72
7.3.00.0060.00716.53
7.2.330.0030.01416.88
7.2.320.0070.01016.90
7.2.310.0140.01016.58
7.2.300.0080.01316.47
7.2.290.0090.01316.84
7.2.250.0100.00915.07
7.2.240.0050.01314.98
7.2.230.0040.01215.04
7.2.220.0050.00615.16
7.2.210.0040.01115.14
7.2.200.0030.00815.26
7.2.190.0050.00815.03
7.2.180.0060.00815.21
7.2.170.0070.01015.27
7.2.00.0000.01519.55
7.1.330.0060.00915.75
7.1.320.0070.00515.82
7.1.310.0050.00815.87
7.1.300.0050.00715.75
7.1.290.0060.00815.78
7.1.280.0100.00715.78
7.1.270.0040.00715.73
7.1.260.0020.01215.94
7.1.200.0090.00315.93
7.1.100.0030.00918.38
7.1.70.0030.01017.21
7.1.60.0040.00717.24
7.1.50.0040.01517.00
7.1.00.0070.07322.42
7.0.200.0130.00816.82
7.0.140.0100.06722.15
7.0.100.0100.04019.94
7.0.90.0000.04719.88
7.0.80.0030.05319.91
7.0.70.0030.04019.88
7.0.60.0070.05719.93
7.0.50.0030.04020.36
7.0.40.0100.06320.05
7.0.30.0030.04020.18
7.0.20.0000.06020.14
7.0.10.0070.03720.10
7.0.00.0130.04720.01
5.6.280.0070.06721.03
5.6.250.0170.03720.62
5.6.240.0170.04020.63
5.6.230.0100.04320.46
5.6.220.0130.03020.63
5.6.210.0100.03320.54
5.6.200.0130.08021.05
5.6.190.0000.04021.08
5.6.180.0030.04021.07
5.6.170.0000.05321.18
5.6.160.0100.03021.03
5.6.150.0070.04021.02
5.6.140.0030.04321.08
5.6.130.0070.03720.96
5.6.120.0030.04721.03
5.6.110.0000.04320.94
5.6.100.0070.03321.06
5.6.90.0000.05021.06
5.6.80.0100.03320.50
5.6.70.0100.03320.56
5.6.60.0030.04020.49
5.6.50.0030.04020.43
5.6.40.0030.04020.43
5.6.30.0000.04020.43
5.6.20.0130.04320.29
5.6.10.0030.06320.35
5.6.00.0130.07320.43
5.5.380.0000.04320.52
5.5.370.0000.05320.33
5.5.360.0030.04020.36
5.5.350.0030.05020.30
5.5.340.0070.07020.70
5.5.330.0070.03320.93
5.5.320.0000.05720.65
5.5.310.0100.03720.65
5.5.300.0000.05020.65
5.5.290.0030.05720.84
5.5.280.0000.04320.74
5.5.270.0000.04320.93
5.5.260.0000.04320.86
5.5.250.0000.06320.60
5.5.240.0070.03320.23
5.5.230.0030.04020.26
5.5.220.0030.03720.18
5.5.210.0030.04720.28
5.5.200.0070.06320.19
5.5.190.0100.03320.09
5.5.180.0030.03720.25
5.5.160.0030.07720.27
5.5.150.0070.08020.16
5.5.140.0030.08320.22
5.5.130.0070.08020.28
5.5.120.0070.06020.21
5.5.110.0070.08320.17
5.5.100.0130.07320.18
5.5.90.0030.07320.08
5.5.80.0100.08020.17
5.5.70.0130.07320.10
5.5.60.0070.07720.13
5.5.50.0130.07020.16
5.5.40.0030.07720.04
5.5.30.0030.08720.06
5.5.20.0100.07719.93
5.5.10.0170.06320.03
5.5.00.0030.08720.13
5.4.450.0070.03319.36
5.4.440.0100.04019.35
5.4.430.0100.03719.35
5.4.420.0030.03719.22
5.4.410.0030.06319.28
5.4.400.0030.04019.05
5.4.390.0030.04318.78
5.4.380.0000.04019.03
5.4.370.0030.03718.97
5.4.360.0070.03719.05
5.4.350.0070.03719.12
5.4.340.0030.03719.12
5.4.320.0070.07019.02
5.4.310.0170.06718.98
5.4.300.0100.07319.14
5.4.290.0130.05319.03
5.4.280.0070.07719.04
5.4.270.0100.07018.96
5.4.260.0130.07019.02
5.4.250.0000.06718.97
5.4.240.0070.06719.05
5.4.230.0100.05719.14
5.4.220.0170.07019.09
5.4.210.0100.05719.13
5.4.200.0200.05719.11
5.4.190.0100.07019.03
5.4.180.0100.07718.80
5.4.170.0030.07318.96
5.4.160.0100.07319.02
5.4.150.0170.07318.76
5.4.140.0070.07716.32
5.4.130.0000.06716.21
5.4.120.0070.06316.06
5.4.110.0000.05316.40
5.4.100.0030.06316.32
5.4.90.0000.07716.45
5.4.80.0130.03316.43
5.4.70.0030.07716.44
5.4.60.0100.07316.34
5.4.50.0100.07316.23
5.4.40.0100.06316.36
5.4.30.0070.06716.29
5.4.20.0030.05716.38
5.4.10.0070.03716.33
5.4.00.0070.06015.68
5.3.290.0100.07714.68
5.3.280.0000.08314.52
5.3.270.0100.06314.46
5.3.260.0000.08314.57
5.3.250.0100.07314.64
5.3.240.0030.06714.61
5.3.230.0030.04314.62
5.3.220.0130.06714.59
5.3.210.0170.07314.58
5.3.200.0100.07014.45
5.3.190.0070.04014.45
5.3.180.0000.04014.59
5.3.170.0130.07314.46
5.3.160.0070.07714.57
5.3.150.0170.06314.58
5.3.140.0070.05314.53
5.3.130.0070.08014.57
5.3.120.0130.07314.39
5.3.110.0000.07314.52
5.3.100.0030.06713.90
5.3.90.0030.05714.04
5.3.80.0070.05314.05
5.3.70.0030.04313.95
5.3.60.0030.07713.93
5.3.50.0070.07313.93
5.3.40.0100.07313.82
5.3.30.0030.05313.92
5.3.20.0030.05013.69
5.3.10.0030.07313.43
5.3.00.0070.07013.61
5.2.170.0130.06011.34
5.2.160.0070.05711.34
5.2.150.0130.05311.34
5.2.140.0030.06711.34
5.2.130.0030.06311.34
5.2.120.0000.04711.34
5.2.110.0030.06311.34
5.2.100.0030.06011.34
5.2.90.0130.03711.34
5.2.80.0000.06011.34
5.2.70.0030.03011.34
5.2.60.0000.06311.34
5.2.50.0100.06011.34
5.2.40.0130.05011.34
5.2.30.0030.06011.34
5.2.20.0030.03711.34
5.2.10.0130.05011.34
5.2.00.0070.04311.34
5.1.60.0070.04711.34
5.1.50.0030.04011.34
5.1.40.0100.03311.34
5.1.30.0030.05311.34
5.1.20.0030.06011.34
5.1.10.0030.03711.34
5.1.00.0030.05311.34
5.0.50.0100.03311.34
5.0.40.0070.04011.34
5.0.30.0000.06711.34
5.0.20.0070.04011.34
5.0.10.0070.03711.34
5.0.00.0100.05711.34
4.4.90.0070.02011.34
4.4.80.0030.03311.34
4.4.70.0000.01711.34
4.4.60.0030.03311.34
4.4.50.0030.02711.34
4.4.40.0070.04711.34
4.4.30.0000.03311.34
4.4.20.0030.02311.34
4.4.10.0000.03711.34
4.4.00.0030.05311.34
4.3.110.0030.03311.34
4.3.100.0000.02711.34
4.3.90.0030.03311.34
4.3.80.0030.05311.34
4.3.70.0000.03311.34
4.3.60.0000.03011.34
4.3.50.0000.03711.34
4.3.40.0030.05011.34
4.3.30.0000.03011.34
4.3.20.0000.02011.34
4.3.10.0100.03011.34
4.3.00.0000.02011.34

preferences:
45.84 ms | 400 KiB | 5 Q