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;1989'; $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"; } } } 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.0170.00316.50
8.3.50.0080.01022.00
8.3.40.0110.01118.84
8.3.30.0110.00319.09
8.3.20.0060.00320.35
8.3.10.0040.00423.70
8.3.00.0030.00519.50
8.2.180.0040.01118.17
8.2.170.0120.00322.96
8.2.160.0110.00320.44
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00022.19
8.2.110.0030.00720.97
8.2.100.0060.00617.84
8.2.90.0050.00319.41
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0090.00018.05
8.2.50.0080.00018.07
8.2.40.0000.00918.40
8.2.30.0000.00818.09
8.2.20.0040.00417.69
8.2.10.0000.00718.15
8.2.00.0030.00617.78
8.1.280.0170.00325.92
8.1.270.0030.00623.70
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0040.00820.69
8.1.230.0080.00319.22
8.1.220.0000.00717.78
8.1.210.0000.00918.77
8.1.200.0060.00317.48
8.1.190.0040.00417.43
8.1.180.0080.00018.10
8.1.170.0050.00318.58
8.1.160.0000.00822.04
8.1.150.0000.00718.58
8.1.140.0000.00717.36
8.1.130.0070.00017.89
8.1.120.0040.00417.38
8.1.110.0000.00817.52
8.1.100.0000.00717.49
8.1.90.0040.00417.52
8.1.80.0050.00317.49
8.1.70.0030.00317.36
8.1.60.0080.00017.61
8.1.50.0060.00317.57
8.1.40.0040.00417.53
8.1.30.0050.00317.62
8.1.20.0060.00317.57
8.1.10.0000.00817.49
8.1.00.0000.00817.58
8.0.300.0040.00418.77
8.0.290.0040.00417.18
8.0.280.0000.00718.44
8.0.270.0000.00717.16
8.0.260.0000.00716.80
8.0.250.0000.00717.00
8.0.240.0030.00616.92
8.0.230.0020.00516.89
8.0.220.0030.00316.93
8.0.210.0000.00716.89
8.0.200.0030.00316.99
8.0.190.0050.00217.00
8.0.180.0000.00716.85
8.0.170.0040.00416.94
8.0.160.0050.00317.00
8.0.150.0070.00416.99
8.0.140.0040.00416.94
8.0.130.0060.00013.34
8.0.120.0000.00816.87
8.0.110.0050.00216.82
8.0.100.0000.00816.70
8.0.90.0070.00016.95
8.0.80.0130.00316.96
8.0.70.0000.00716.91
8.0.60.0040.00416.92
8.0.50.0040.00416.87
8.0.30.0060.01317.13
8.0.20.0060.01317.40
8.0.10.0000.00817.04
8.0.00.0090.00916.96
7.4.330.0000.00715.00
7.4.320.0000.00616.69
7.4.300.0030.00316.45
7.4.290.0060.00316.64
7.4.280.0070.00016.50
7.4.270.0000.00716.63
7.4.260.0030.00316.44
7.4.250.0030.00516.64
7.4.240.0050.00316.53
7.4.230.0040.00416.45
7.4.220.0070.01316.49
7.4.210.0050.00916.61
7.4.200.0030.00316.75
7.4.190.0070.00016.68
7.4.160.0080.00816.45
7.4.150.0150.00317.40
7.4.140.0120.01817.86
7.4.130.0120.00816.60
7.4.120.0040.01316.42
7.4.110.0200.00416.55
7.4.100.0120.01216.66
7.4.90.0090.00916.47
7.4.80.0110.01119.39
7.4.70.0110.03016.63
7.4.60.0060.01216.48
7.4.50.0030.00616.50
7.4.40.0000.01422.77
7.4.30.0110.01116.61
7.4.00.0100.00615.02
7.3.330.0030.00313.20
7.3.320.0060.00013.26
7.3.310.0030.00316.23
7.3.300.0000.00716.38
7.3.290.0160.00316.45
7.3.280.0110.00816.35
7.3.270.0130.00317.40
7.3.260.0130.01416.47
7.3.250.0090.00916.59
7.3.240.0140.01316.38
7.3.230.0070.01416.42
7.3.210.0080.00816.31
7.3.200.0130.00719.39
7.3.190.0060.01616.48
7.3.180.0080.00816.46
7.3.170.0090.00816.48
7.3.160.0090.00716.37
7.3.120.0110.00414.80
7.3.10.0050.01016.43
7.3.00.0070.01116.39
7.2.330.0160.00016.80
7.2.320.0110.00516.83
7.2.310.0150.00316.75
7.2.300.0090.00916.46
7.2.290.0100.00716.75
7.2.130.0060.00916.66
7.2.120.0090.00816.66
7.2.110.0060.01516.89
7.2.100.0120.00716.73
7.2.90.0050.01116.68
7.2.80.0120.00716.70
7.2.70.0100.00916.64
7.2.60.0100.01016.75
7.2.50.0050.01416.62
7.2.40.0110.01116.62
7.2.30.0090.01416.49
7.2.20.0110.01216.79
7.2.10.0150.00716.60
7.2.00.0070.01017.79
7.1.250.0150.00515.62
7.1.100.0070.00718.23
7.1.70.0060.00317.22
7.1.60.0070.01719.33
7.1.50.0000.02116.68
7.1.00.0000.09322.33
7.0.200.0070.00716.74
7.0.140.0000.07722.15
7.0.90.0030.08721.64
7.0.80.0070.08021.77
7.0.70.0130.06321.67
7.0.60.0000.08721.82
7.0.50.0030.08022.14
7.0.40.0070.07319.95
7.0.30.0030.08020.02
7.0.20.0000.08720.09
7.0.10.0100.07720.07
7.0.00.0100.06720.12
5.6.280.0000.07720.79
5.6.240.0030.08720.63
5.6.230.0070.06320.57
5.6.220.0100.07320.53
5.6.210.0100.07320.64
5.6.200.0070.06320.92
5.6.190.0070.08021.06
5.6.180.0100.03321.09
5.6.170.0030.07720.96
5.6.160.0000.08021.00
5.6.150.0200.07021.12
5.6.140.0070.07021.02
5.6.130.0070.07321.02
5.6.120.0130.07021.04
5.6.110.0100.08320.96
5.6.100.0070.07721.11
5.6.90.0070.06020.95
5.6.80.0070.05720.42
5.6.70.0000.04720.35
5.6.60.0000.06720.35
5.6.50.0070.07720.36
5.6.40.0030.08020.39
5.6.30.0030.04720.33
5.6.20.0000.04320.29
5.6.10.0070.04020.48
5.6.00.0030.08020.35
5.5.380.0070.07320.35
5.5.370.0030.06020.27
5.5.360.0030.08020.35
5.5.350.0030.09020.39
5.5.340.0070.07320.78
5.5.330.0000.07320.79
5.5.320.0130.07020.69
5.5.310.0070.07320.71
5.5.300.0070.06720.76
5.5.290.0070.08320.76
5.5.280.0030.04020.76
5.5.270.0070.07320.87
5.5.260.0100.04020.82
5.5.250.0070.04320.53
5.5.240.0100.07320.12
5.5.230.0030.04320.17
5.5.220.0070.06020.23
5.5.210.0070.07020.14
5.5.200.0000.07020.11
5.5.190.0000.06320.09
5.5.180.0030.08020.20
5.5.160.0130.06020.12
5.5.150.0000.08019.95
5.5.140.0070.06720.20
5.5.130.0100.03720.21
5.5.120.0000.05020.06
5.5.110.0070.07320.22
5.5.100.0070.07020.13
5.5.90.0000.08320.11
5.5.80.0030.07320.13
5.5.70.0000.08020.00
5.5.60.0070.07719.91
5.5.50.0000.07020.11
5.5.40.0130.06020.04
5.5.30.0070.04020.09
5.5.20.0000.05720.09
5.5.10.0130.06020.06
5.5.00.0030.07320.08
5.4.450.0070.09319.27
5.4.440.0000.04319.11
5.4.430.0100.03719.11
5.4.420.0070.07719.22
5.4.410.0100.06019.10
5.4.400.0000.08019.15
5.4.390.0030.06319.23
5.4.380.0000.06718.84
5.4.370.0030.07018.81
5.4.360.0000.05319.09
5.4.350.0070.04319.03
5.4.340.0000.04718.79
5.4.320.0000.04319.06
5.4.310.0000.04719.05
5.4.300.0100.07019.07
5.4.290.0100.06318.98
5.4.280.0000.07319.04
5.4.270.0000.04718.90
5.4.260.0070.05318.94
5.4.250.0100.06319.11
5.4.240.0130.06719.11
5.4.230.0100.03719.11
5.4.220.0030.05018.80
5.4.210.0030.04019.12
5.4.200.0000.05719.11
5.4.190.0070.06718.80
5.4.180.0170.02719.08
5.4.170.0030.07019.05
5.4.160.0030.04319.07
5.4.150.0030.06319.00
5.4.140.0030.04016.08
5.4.130.0000.06316.28
5.4.120.0070.06316.23
5.4.110.0000.06316.23
5.4.100.0000.07016.23
5.4.90.0030.06316.23
5.4.80.0100.04716.20
5.4.70.0070.03716.21
5.4.60.0030.07316.20
5.4.50.0030.04016.23
5.4.40.0070.03316.24
5.4.30.0000.07016.23
5.4.20.0000.06016.31
5.4.10.0030.06016.18
5.4.00.0030.07315.66
5.3.290.0070.04014.54
5.3.280.0070.05714.48
5.3.270.0100.06714.60
5.3.260.0070.03714.61
5.3.250.0030.06314.58
5.3.240.0030.06314.57
5.3.230.0030.06014.45
5.3.220.0030.06014.45
5.3.210.0070.04314.45
5.3.200.0030.07014.45
5.3.190.0000.07714.57
5.3.180.0000.06714.52
5.3.170.0030.07314.59
5.3.160.0030.04014.41
5.3.150.0030.06014.60
5.3.140.0000.04314.44
5.3.130.0070.07014.56
5.3.120.0000.06314.43
5.3.110.0100.03714.56
5.3.100.0100.06713.92
5.3.90.0000.05013.95
5.3.80.0000.07313.81
5.3.70.0030.06713.90
5.3.60.0000.04013.89
5.3.50.0000.07713.91
5.3.40.0030.07313.73
5.3.30.0000.04013.79
5.3.20.0100.05013.66
5.3.10.0070.04313.54
5.3.00.0030.04013.52
5.2.170.0070.03712.33
5.2.160.0000.05712.33
5.2.150.0030.03712.33
5.2.140.0000.04312.33
5.2.130.0000.06012.33
5.2.120.0070.06012.33
5.2.110.0000.03312.33
5.2.100.0000.06012.33
5.2.90.0030.03712.33
5.2.80.0030.03012.33
5.2.70.0000.03712.33
5.2.60.0030.04712.33
5.2.50.0000.04712.33
5.2.40.0070.05312.33
5.2.30.0030.06012.33
5.2.20.0030.06012.33
5.2.10.0030.06012.33
5.2.00.0000.06012.33
5.1.60.0000.02712.33
5.1.50.0030.06012.33
5.1.40.0000.05012.33
5.1.30.0030.06012.33
5.1.20.0030.04312.33
5.1.10.0000.03012.33
5.1.00.0030.04712.33
5.0.50.0000.02712.33
5.0.40.0030.02012.33
5.0.30.0030.06012.33
5.0.20.0000.04712.33
5.0.10.0100.02712.33
5.0.00.0000.06712.33
4.4.90.0030.03312.33
4.4.80.0030.03012.33
4.4.70.0030.01712.33
4.4.60.0030.02312.33
4.4.50.0000.02012.33
4.4.40.0000.05712.33
4.4.30.0030.03312.33
4.4.20.0000.02012.33
4.4.10.0030.03312.33
4.4.00.0030.04712.33
4.3.110.0000.02712.33
4.3.100.0030.03012.33
4.3.90.0030.03012.33
4.3.80.0030.05012.33
4.3.70.0100.02012.33
4.3.60.0000.01312.33
4.3.50.0000.03012.33
4.3.40.0000.05012.33
4.3.30.0000.02712.33
4.3.20.0030.03312.33
4.3.10.0000.03712.33
4.3.00.0030.03312.33

preferences:
42.08 ms | 401 KiB | 5 Q