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;1900'; $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.0120.00318.55
8.3.50.0230.00922.13
8.3.40.0040.01118.84
8.3.30.0110.00419.12
8.3.20.0040.00420.20
8.3.10.0040.00421.93
8.3.00.0040.00722.44
8.2.180.0070.01118.20
8.2.170.0140.00322.96
8.2.160.0080.00621.07
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.23
8.2.110.0030.00622.13
8.2.100.0040.00817.59
8.2.90.0040.00419.35
8.2.80.0050.00318.05
8.2.70.0090.00017.50
8.2.60.0050.00317.93
8.2.50.0030.00518.07
8.2.40.0050.00318.28
8.2.30.0040.00418.03
8.2.20.0050.00217.75
8.2.10.0000.00817.84
8.2.00.0030.00617.82
8.1.280.0070.00725.92
8.1.270.0020.00523.91
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0070.00323.82
8.1.230.0110.00018.96
8.1.220.0030.00517.91
8.1.210.0030.00618.77
8.1.200.0110.00417.36
8.1.190.0000.00817.63
8.1.180.0040.00418.10
8.1.170.0040.00418.61
8.1.160.0050.00521.98
8.1.150.0080.00018.71
8.1.140.0000.00717.45
8.1.130.0030.00517.84
8.1.120.0030.00517.51
8.1.110.0040.00417.52
8.1.100.0000.00717.53
8.1.90.0000.00817.52
8.1.80.0000.00917.39
8.1.70.0030.00317.46
8.1.60.0030.00617.55
8.1.50.0000.00817.45
8.1.40.0040.00417.55
8.1.30.0040.00417.57
8.1.20.0030.00517.63
8.1.10.0050.00317.60
8.1.00.0040.00417.39
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0030.00318.47
8.0.270.0070.00017.34
8.0.260.0030.00316.84
8.0.250.0040.00416.93
8.0.240.0070.00016.90
8.0.230.0030.00316.99
8.0.220.0070.00016.95
8.0.210.0000.00816.96
8.0.200.0040.00416.91
8.0.190.0000.00817.03
8.0.180.0000.00716.86
8.0.170.0000.00816.96
8.0.160.0070.00016.87
8.0.150.0000.00716.87
8.0.140.0040.00416.89
8.0.130.0030.00313.39
8.0.120.0000.00816.78
8.0.110.0040.00416.88
8.0.100.0040.00416.77
8.0.90.0000.00716.84
8.0.80.0030.01316.91
8.0.70.0000.00816.88
8.0.60.0040.00416.99
8.0.50.0050.00216.91
8.0.30.0080.01517.11
8.0.20.0070.01217.40
8.0.10.0040.00416.99
8.0.00.0100.00816.91
7.4.330.0050.00015.09
7.4.320.0060.00016.46
7.4.300.0000.00716.52
7.4.290.0030.00516.52
7.4.280.0000.00816.53
7.4.270.0070.00416.58
7.4.260.0040.00416.46
7.4.250.0070.00016.55
7.4.240.0000.00716.63
7.4.230.0000.00816.64
7.4.220.0160.00616.71
7.4.210.0060.00816.60
7.4.200.0000.00716.72
7.4.190.0070.00016.78
7.4.160.0060.01116.69
7.4.150.0140.00717.40
7.4.140.0090.00917.86
7.4.130.0110.00716.59
7.4.120.0040.01316.56
7.4.110.0170.00716.54
7.4.100.0120.00816.52
7.4.90.0140.00916.43
7.4.80.0100.00719.39
7.4.70.0060.01116.58
7.4.60.0090.00916.38
7.4.50.0030.00516.39
7.4.40.0000.01222.77
7.4.30.0090.00816.75
7.4.00.0090.00914.84
7.3.330.0030.00313.20
7.3.320.0050.00013.21
7.3.310.0000.00716.30
7.3.300.0070.00016.35
7.3.290.0150.00016.33
7.3.280.0050.01216.33
7.3.270.0100.00717.40
7.3.260.0070.01516.40
7.3.250.0100.01116.47
7.3.240.0030.01316.32
7.3.230.0030.01316.45
7.3.210.0070.01416.44
7.3.200.0160.00619.39
7.3.190.0130.00416.32
7.3.180.0100.00716.45
7.3.170.0100.01116.58
7.3.160.0130.00616.52
7.3.120.0040.01114.81
7.3.110.0080.00915.10
7.3.100.0060.00614.96
7.3.90.0080.00815.00
7.3.80.0110.00714.79
7.3.70.0030.01014.85
7.3.60.0050.00914.85
7.3.50.0070.00515.03
7.3.40.0070.00714.91
7.3.30.0090.00514.92
7.3.20.0050.00716.72
7.3.10.0120.00416.65
7.3.00.0060.00816.58
7.2.330.0110.00616.77
7.2.320.0060.01016.76
7.2.310.0130.01016.52
7.2.300.0090.00816.48
7.2.290.0100.00616.85
7.2.250.0090.01215.21
7.2.240.0030.01315.02
7.2.230.0050.01015.11
7.2.220.0070.00815.15
7.2.210.0050.00914.92
7.2.200.0090.00715.14
7.2.190.0090.00515.09
7.2.180.0050.01015.27
7.2.170.0080.00815.08
7.2.160.0100.00315.23
7.2.150.0040.01216.71
7.2.140.0070.01116.73
7.2.130.0060.00816.87
7.2.120.0070.00516.88
7.2.110.0000.01417.01
7.2.100.0030.01016.96
7.2.90.0070.00816.98
7.2.80.0110.00716.97
7.2.70.0030.01016.95
7.2.60.0080.00616.89
7.2.50.0080.00817.10
7.2.40.0040.00917.00
7.2.30.0130.00416.78
7.2.20.0050.00916.96
7.2.10.0070.00717.00
7.2.00.0030.01017.91
7.1.330.0050.00915.81
7.1.320.0100.00415.76
7.1.310.0080.00715.72
7.1.300.0050.00615.76
7.1.290.0050.00915.80
7.1.280.0030.00915.83
7.1.270.0060.00515.80
7.1.260.0070.00815.85
7.1.250.0060.00515.80
7.1.100.0030.01018.04
7.1.70.0040.00416.87
7.1.60.0100.01419.82
7.1.50.0030.01216.99
7.1.00.0030.07722.30
7.0.200.0070.00316.85
7.0.140.0030.07722.00
7.0.110.0170.03320.12
7.0.100.0100.03720.04
7.0.90.0170.02720.05
7.0.80.0100.05019.99
7.0.70.0100.08720.07
7.0.60.0070.06320.04
7.0.50.0030.05019.93
7.0.40.0130.07719.61
7.0.30.0070.03319.82
7.0.20.0130.04719.71
7.0.10.0000.06319.74
7.0.00.0270.06019.64
5.6.280.0100.06721.12
5.6.260.0030.04320.66
5.6.250.0030.04020.59
5.6.240.0000.04020.49
5.6.230.0030.03720.70
5.6.220.0100.03320.66
5.6.210.0030.04720.73
5.6.200.0100.05720.57
5.6.190.0030.07320.63
5.6.180.0100.05320.63
5.6.170.0030.08020.86
5.6.160.0070.07320.63
5.6.150.0030.05720.69
5.6.140.0070.07720.64
5.6.130.0130.06020.46
5.6.120.0000.04320.59
5.6.110.0100.08020.62
5.6.100.0070.03720.85
5.6.90.0130.08020.70
5.6.80.0100.03320.05
5.6.70.0000.04020.00
5.6.60.0170.07320.02
5.6.50.0070.07720.05
5.6.40.0030.07720.05
5.6.30.0030.04319.93
5.6.20.0000.07320.00
5.6.10.0070.04320.00
5.6.00.0070.07719.98
5.5.380.0030.04317.50
5.5.370.0070.03017.50
5.5.360.0030.06017.62
5.5.350.0030.08317.62
5.5.340.0030.03318.12
5.5.330.0000.03718.25
5.5.320.0000.03717.86
5.5.310.0070.04318.25
5.5.300.0030.04717.86
5.5.290.0070.08318.10
5.5.280.0100.03018.05
5.5.270.0000.04018.16
5.5.260.0030.08717.98
5.5.250.0000.05017.92
5.5.240.0000.08317.54
5.5.230.0000.03717.47
5.5.220.0070.06317.50
5.5.210.0000.04317.56
5.5.200.0100.04317.22
5.5.190.0030.06017.47
5.5.180.0130.06717.52
5.5.160.0070.04717.24
5.5.150.0130.03317.11
5.5.140.0100.05317.20
5.5.130.0000.04017.23
5.5.120.0000.07717.37
5.5.110.0100.04717.19
5.5.100.0170.06017.42
5.5.90.0100.05317.11
5.5.80.0070.04017.10
5.5.70.0000.08317.40
5.5.60.0030.04717.33
5.5.50.0130.05717.22
5.5.40.0130.06017.23
5.5.30.0030.06017.08
5.5.20.0070.06717.36
5.5.10.0070.07717.36
5.5.00.0070.08017.40
5.4.450.0130.05019.31
5.4.440.0000.06019.33
5.4.430.0100.08019.27
5.4.420.0000.05319.25
5.4.410.0130.04019.16
5.4.400.0030.04718.98
5.4.390.0100.05019.10
5.4.380.0070.04018.98
5.4.370.0030.06019.12
5.4.360.0070.05719.18
5.4.350.0070.05318.96
5.4.340.0030.09719.13
5.4.320.0070.07018.93
5.4.310.0200.06319.16
5.4.300.0070.03718.95
5.4.290.0030.04019.02
5.4.280.0030.08019.00
5.4.270.0100.06719.08
5.4.260.0000.04318.94
5.4.250.0230.06019.07
5.4.240.0270.03318.92
5.4.230.0030.08319.11
5.4.220.0100.04019.27
5.4.210.0000.04318.98
5.4.200.0030.06319.11
5.4.190.0100.06319.26
5.4.180.0070.05019.24
5.4.170.0100.06719.01
5.4.160.0130.05718.88
5.4.150.0170.06719.05
5.4.140.0030.07716.21
5.4.130.0030.03716.46
5.4.120.0100.03716.54
5.4.110.0100.03016.51
5.4.100.0070.06716.55
5.4.90.0100.05316.53
5.4.80.0030.04016.19
5.4.70.0030.03716.37
5.4.60.0070.05716.37
5.4.50.0070.03316.21
5.4.40.0070.07016.31
5.4.30.0000.06716.21
5.4.20.0130.06016.16
5.4.10.0000.07016.36
5.4.00.0000.05015.70
5.3.290.0170.06714.80
5.3.280.0070.04314.64
5.3.270.0000.06314.51
5.3.260.0100.07014.65
5.3.250.0100.07314.64
5.3.240.0000.07714.50
5.3.230.0030.08014.47
5.3.220.0070.04014.48
5.3.210.0070.03714.42
5.3.200.0030.05714.53
5.3.190.0070.06714.55
5.3.180.0100.06314.51
5.3.170.0030.04314.49
5.3.160.0070.04014.53
5.3.150.0100.04714.52
5.3.140.0030.04714.36
5.3.130.0070.04714.46
5.3.120.0130.07014.57
5.3.110.0130.02714.43
5.3.100.0070.07313.94
5.3.90.0170.07013.89
5.3.80.0100.06713.97
5.3.70.0070.03714.13
5.3.60.0030.04014.04
5.3.50.0030.07313.84
5.3.40.0030.07313.87
5.3.30.0030.06313.87
5.3.20.0130.03713.65
5.3.10.0030.05713.55
5.3.00.0070.04013.60
5.2.170.0070.06011.98
5.2.160.0000.03711.98
5.2.150.0030.02711.98
5.2.140.0100.05311.98
5.2.130.0030.05311.98
5.2.120.0070.05011.98
5.2.110.0030.06011.98
5.2.100.0100.05711.98
5.2.90.0000.03311.98
5.2.80.0030.04011.98
5.2.70.0070.02311.98
5.2.60.0030.06011.98
5.2.50.0000.06311.98
5.2.40.0000.05011.98
5.2.30.0030.03011.98
5.2.20.0000.06711.98
5.2.10.0030.05011.98
5.2.00.0100.05311.98
5.1.60.0000.02711.98
5.1.50.0000.05711.98
5.1.40.0070.04011.98
5.1.30.0030.05711.98
5.1.20.0030.05311.98
5.1.10.0070.05311.98
5.1.00.0100.03711.98
5.0.50.0030.03711.98
5.0.40.0000.04711.98
5.0.30.0000.06011.98
5.0.20.0030.02711.98
5.0.10.0000.04311.98
5.0.00.0000.04311.98
4.4.90.0030.03311.98
4.4.80.0030.01311.98
4.4.70.0000.01711.98
4.4.60.0000.03311.98
4.4.50.0070.03311.98
4.4.40.0030.03711.98
4.4.30.0000.04011.98
4.4.20.0000.03711.98
4.4.10.0000.02311.98
4.4.00.0000.02711.98
4.3.110.0000.03311.98
4.3.100.0030.03011.98
4.3.90.0000.03011.98
4.3.80.0000.05311.98
4.3.70.0030.03711.98
4.3.60.0070.01711.98
4.3.50.0000.03311.98
4.3.40.0030.03311.98
4.3.30.0000.03311.98
4.3.20.0000.01711.98
4.3.10.0000.02311.98
4.3.00.0030.01311.98

preferences:
48.02 ms | 401 KiB | 5 Q