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 "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.0030.01716.63
8.3.50.0100.01417.59
8.3.40.0130.00718.96
8.3.30.0040.01118.92
8.3.20.0080.00419.03
8.3.10.0040.00420.84
8.3.00.0080.00417.63
8.2.180.0110.00316.63
8.2.170.0140.00722.96
8.2.160.0120.00320.32
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.02
8.2.110.0090.00921.00
8.2.100.0080.00317.91
8.2.90.0030.00619.47
8.2.80.0000.00819.34
8.2.70.0000.01017.63
8.2.60.0040.00418.16
8.2.50.0050.00318.07
8.2.40.0030.00618.19
8.2.30.0000.01018.08
8.2.20.0030.00619.43
8.2.10.0070.00017.73
8.2.00.0050.00317.89
8.1.280.0100.01025.92
8.1.270.0000.00824.66
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0100.00022.73
8.1.230.0030.00920.91
8.1.220.0080.00017.89
8.1.210.0050.00318.84
8.1.200.0060.00317.47
8.1.190.0000.00817.52
8.1.180.0000.00818.10
8.1.170.0030.00618.77
8.1.160.0040.00418.94
8.1.150.0040.00418.75
8.1.140.0000.00717.60
8.1.130.0030.00317.82
8.1.120.0040.00417.58
8.1.110.0030.00517.59
8.1.100.0040.00417.53
8.1.90.0040.00417.60
8.1.80.0040.00317.64
8.1.70.0000.00717.55
8.1.60.0060.00317.70
8.1.50.0020.00517.59
8.1.40.0040.00417.64
8.1.30.0060.00317.72
8.1.20.0040.00417.61
8.1.10.0050.00317.71
8.1.00.0030.00517.52
8.0.300.0040.00420.04
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0000.00817.27
8.0.260.0000.00716.98
8.0.250.0000.00717.03
8.0.240.0040.00417.00
8.0.230.0050.00217.11
8.0.220.0030.00516.95
8.0.210.0030.00317.02
8.0.200.0030.00317.09
8.0.190.0000.00717.12
8.0.180.0070.00016.98
8.0.170.0040.00416.95
8.0.160.0000.00716.90
8.0.150.0040.00416.92
8.0.140.0070.00316.98
8.0.130.0050.00013.31
8.0.120.0000.00817.00
8.0.110.0070.00016.97
8.0.100.0040.00417.10
8.0.90.0030.00516.79
8.0.80.0120.00317.03
8.0.70.0040.00417.11
8.0.60.0050.00316.96
8.0.50.0030.00616.86
8.0.30.0030.01317.17
8.0.20.0170.01217.18
8.0.10.0030.00517.16
8.0.00.0060.01416.96
7.4.330.0050.00013.08
7.4.320.0000.00716.73
7.4.300.0030.00316.50
7.4.290.0070.00016.75
7.4.280.0030.00616.61
7.4.270.0070.00016.63
7.4.260.0030.00313.32
7.4.250.0030.00616.48
7.4.240.0050.00316.52
7.4.230.0030.00316.44
7.4.220.0120.00816.64
7.4.210.0120.00816.73
7.4.200.0060.00316.70
7.4.190.0070.00016.65
7.4.160.0090.00616.67
7.4.150.0060.01216.54
7.4.140.0100.00716.74
7.4.130.0090.00916.64
7.4.120.0090.00816.56
7.4.110.0170.00016.52
7.4.100.0140.01116.73
7.4.90.0110.00716.79
7.4.80.0190.02616.69
7.4.70.0130.00316.85
7.4.60.0080.00816.43
7.4.50.0000.00516.79
7.4.40.0040.01116.28
7.4.30.0030.01216.51
7.4.00.0040.00815.06
7.3.330.0000.00513.18
7.3.320.0030.00313.30
7.3.310.0040.00416.25
7.3.300.0030.00316.34
7.3.290.0060.00916.42
7.3.280.0030.01216.46
7.3.270.0110.01416.53
7.3.260.0070.01116.34
7.3.250.0100.00916.64
7.3.240.0110.00616.50
7.3.230.0040.01416.70
7.3.210.0040.01216.41
7.3.200.0060.01619.39
7.3.190.0150.00416.46
7.3.180.0100.00716.62
7.3.170.0090.01216.70
7.3.160.0030.01716.36
7.3.120.0110.00415.18
7.3.10.0120.00316.79
7.3.00.0030.01416.82
7.2.330.0090.00916.78
7.2.320.0180.00416.79
7.2.310.0150.00916.89
7.2.300.0000.02316.79
7.2.290.0090.00816.66
7.2.130.0080.00817.08
7.2.120.0000.01717.00
7.2.110.0070.00716.94
7.2.100.0000.01416.94
7.2.90.0060.00917.02
7.2.80.0070.01017.20
7.2.70.0030.01516.77
7.2.60.0030.01117.03
7.2.50.0090.00617.10
7.2.40.0040.01416.92
7.2.30.0060.00317.02
7.2.20.0120.00317.17
7.2.10.0120.00316.99
7.2.00.0040.01018.07
7.1.250.0030.00915.89
7.1.200.0240.00015.92
7.1.100.0060.00618.36
7.1.70.0030.00717.07
7.1.60.0070.01719.31
7.1.50.0030.01216.77
7.1.00.0070.04322.32
7.0.200.0040.00416.65
7.0.140.0100.06722.07
7.0.120.0000.07722.05
7.0.110.0370.07719.84
7.0.100.0570.07719.96
7.0.90.0570.08020.02
7.0.80.0600.08319.90
7.0.70.0630.06719.94
7.0.60.0500.07719.93
7.0.50.0430.04020.35
7.0.40.0100.08320.19
7.0.30.0100.06020.23
7.0.20.0200.06720.22
7.0.10.0100.08020.16
7.0.00.0170.07019.93
5.6.280.0070.07020.91
5.6.250.0070.05720.62
5.6.240.0130.07720.82
5.6.230.0070.06020.62
5.6.220.0070.07720.63
5.6.210.0030.08720.69
5.6.200.0170.07320.91
5.6.190.0000.07021.08
5.6.180.0030.08720.92
5.6.170.0100.06320.86
5.6.160.0170.07321.01
5.6.150.0070.05321.10
5.6.140.0030.06721.01
5.6.130.0030.05721.10
5.6.120.0070.06320.91
5.6.110.0070.08321.00
5.6.100.0070.08321.03
5.6.90.0100.08321.19
5.6.80.0030.07720.42
5.6.70.0030.08020.27
5.6.60.0070.08320.23
5.6.50.0100.07320.55
5.6.40.0000.08320.51
5.6.30.0070.07720.43
5.6.20.0070.08020.60
5.6.10.0170.07020.27
5.6.00.0030.06320.43
5.5.380.0030.08720.25
5.5.370.0070.08020.43
5.5.360.0100.08020.52
5.5.350.0070.08020.48
5.5.340.0300.06020.76
5.5.330.0100.08020.77
5.5.320.0300.03720.87
5.5.310.0030.09020.66
5.5.300.0100.07720.72
5.5.290.0030.08020.77
5.5.280.0070.05720.74
5.5.270.0070.08320.86
5.5.260.0000.05320.76
5.5.250.0130.06020.79
5.5.240.0070.04720.25
5.5.230.0200.06720.25
5.5.220.0030.08020.04
5.5.210.0070.07720.09
5.5.200.0130.06320.18
5.5.190.0130.06720.15
5.5.180.0170.06720.20
5.5.160.0000.06020.09
5.5.150.0070.07720.25
5.5.140.0030.08320.25
5.5.130.0070.05720.14
5.5.120.0000.04320.15
5.5.110.0200.06020.08
5.5.100.0070.08020.11
5.5.90.0170.07020.13
5.5.80.0070.07320.09
5.5.70.0030.05019.95
5.5.60.0070.07019.95
5.5.50.0130.06320.20
5.5.40.0170.07020.20
5.5.30.0100.07320.02
5.5.20.0100.05320.14
5.5.10.0070.07319.90
5.5.00.0030.08020.19
5.4.450.0070.07719.28
5.4.440.0100.07319.33
5.4.430.0030.08019.39
5.4.420.0070.08019.41
5.4.410.0070.07719.45
5.4.400.0100.07718.94
5.4.390.0100.07319.25
5.4.380.0030.08019.12
5.4.370.0070.07718.98
5.4.360.0000.08719.27
5.4.350.0130.07319.26
5.4.340.0130.07318.91
5.4.320.0100.07719.08
5.4.310.0130.07019.25
5.4.300.0100.07319.01
5.4.290.0100.05719.00
5.4.280.0100.07719.00
5.4.270.0000.07719.12
5.4.260.0030.08319.18
5.4.250.0030.07319.02
5.4.240.0170.06319.00
5.4.230.0200.05718.94
5.4.220.0100.07319.02
5.4.210.0130.07318.99
5.4.200.0070.07019.07
5.4.190.0000.08319.15
5.4.180.0130.06018.91
5.4.170.0170.07019.01
5.4.160.0030.08319.05
5.4.150.0030.08019.09
5.4.140.0170.06316.21
5.4.130.0030.07716.34
5.4.120.0070.04016.48
5.4.110.0000.05016.26
5.4.100.0070.06716.52
5.4.90.0000.08016.54
5.4.80.0000.07716.41
5.4.70.0100.07316.54
5.4.60.0130.06716.61
5.4.50.0200.05716.46
5.4.40.0130.06716.16
5.4.30.0100.07316.49
5.4.20.0030.07716.51
5.4.10.0070.06016.49
5.4.00.0100.07315.62
5.3.290.0070.07314.71
5.3.280.0070.08014.70
5.3.270.0000.08314.70
5.3.260.0100.04314.47
5.3.250.0030.08014.69
5.3.240.0130.06714.64
5.3.230.0070.08014.52
5.3.220.0170.06014.47
5.3.210.0070.07314.60
5.3.200.0100.06714.65
5.3.190.0100.07714.65
5.3.180.0070.07314.49
5.3.170.0000.05314.52
5.3.160.0100.06714.38
5.3.150.0070.06014.59
5.3.140.0100.07314.65
5.3.130.0000.08014.52
5.3.120.0130.07014.57
5.3.110.0100.07314.56
5.3.100.0070.07313.91
5.3.90.0170.06314.06
5.3.80.0070.07013.84
5.3.70.0030.07313.91
5.3.60.0070.07313.91
5.3.50.0070.07714.00
5.3.40.0070.07714.03
5.3.30.0100.06714.02
5.3.20.0130.06313.80
5.3.10.0070.07713.75
5.3.00.0170.06013.60
5.2.170.0030.06311.68
5.2.160.0100.05711.68
5.2.150.0030.05711.68
5.2.140.0030.03011.68
5.2.130.0070.06011.68
5.2.120.0070.06011.68
5.2.110.0100.05011.68
5.2.100.0030.03311.68
5.2.90.0000.04011.68
5.2.80.0030.06011.68
5.2.70.0030.06311.68
5.2.60.0030.06311.68
5.2.50.0030.06011.68
5.2.40.0030.06011.68
5.2.30.0100.05711.68
5.2.20.0070.05711.68
5.2.10.0070.06311.68
5.2.00.0070.06011.68
5.1.60.0100.04711.68
5.1.50.0030.06011.68
5.1.40.0070.04711.68
5.1.30.0100.05311.68
5.1.20.0070.05311.68
5.1.10.0130.02711.68
5.1.00.0030.05311.68
5.0.50.0030.04711.68
5.0.40.0030.04011.68
5.0.30.0070.06011.68
5.0.20.0000.02711.68
5.0.10.0100.03711.68
5.0.00.0000.06711.68
4.4.90.0030.02311.68
4.4.80.0000.03711.68
4.4.70.0000.03711.68
4.4.60.0030.03711.68
4.4.50.0030.02011.68
4.4.40.0000.05011.68
4.4.30.0030.02711.68
4.4.20.0000.02711.68
4.4.10.0130.01711.68
4.4.00.0070.05011.68
4.3.110.0100.02711.68
4.3.100.0030.03311.68
4.3.90.0070.03711.68
4.3.80.0030.05011.68
4.3.70.0030.03011.68
4.3.60.0000.03011.68
4.3.50.0000.02711.68
4.3.40.0000.05311.68
4.3.30.0000.04011.68
4.3.20.0070.03311.68
4.3.10.0000.03711.68
4.3.00.0030.03311.68

preferences:
46.82 ms | 401 KiB | 5 Q