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 = '1990;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"; } } } 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.0090.01218.56
8.3.50.0110.00521.21
8.3.40.0040.01118.89
8.3.30.0110.00418.84
8.3.20.0050.00318.98
8.3.10.0040.00421.21
8.3.00.0040.00423.41
8.2.180.0070.01116.75
8.2.170.0040.01122.96
8.2.160.0000.01420.47
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00321.07
8.2.110.0000.01020.41
8.2.100.0000.01117.84
8.2.90.0050.00319.29
8.2.80.0040.00418.05
8.2.70.0060.00317.61
8.2.60.0000.00818.16
8.2.50.0000.00818.07
8.2.40.0080.00018.41
8.2.30.0060.00321.28
8.2.20.0000.00817.80
8.2.10.0000.00817.77
8.2.00.0000.00917.83
8.1.280.0060.00925.92
8.1.270.0070.00023.99
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0040.00820.89
8.1.220.0000.00818.77
8.1.210.0040.00418.85
8.1.200.0030.00617.60
8.1.190.0080.00019.57
8.1.180.0080.00018.10
8.1.170.0000.00818.62
8.1.160.0040.00419.09
8.1.150.0000.00818.70
8.1.140.0000.00817.60
8.1.130.0070.00017.95
8.1.120.0030.00417.70
8.1.110.0030.00517.59
8.1.100.0080.00017.59
8.1.90.0080.00017.50
8.1.80.0000.00717.58
8.1.70.0030.00317.62
8.1.60.0000.00817.67
8.1.50.0040.00417.54
8.1.40.0090.00017.52
8.1.30.0000.00717.59
8.1.20.0090.00017.74
8.1.10.0000.00817.63
8.1.00.0000.00817.55
8.0.300.0000.00820.01
8.0.290.0000.00717.18
8.0.280.0030.00318.56
8.0.270.0070.00217.34
8.0.260.0070.00016.98
8.0.250.0050.00317.11
8.0.240.0050.00317.13
8.0.230.0000.00717.15
8.0.220.0030.00317.05
8.0.210.0040.00416.95
8.0.200.0030.00317.03
8.0.190.0000.00717.09
8.0.180.0040.00417.07
8.0.170.0000.00716.97
8.0.160.0030.00317.07
8.0.150.0000.00717.02
8.0.140.0080.00016.93
8.0.130.0000.00613.35
8.0.120.0050.00216.84
8.0.110.0000.00816.93
8.0.100.0000.00716.88
8.0.90.0050.00216.98
8.0.80.0040.01116.89
8.0.70.0040.00316.91
8.0.60.0000.00717.02
8.0.50.0000.00816.78
8.0.30.0070.01117.24
8.0.20.0100.00917.40
8.0.10.0050.00216.96
8.0.00.0090.01017.02
7.4.330.0000.00614.77
7.4.320.0060.00016.68
7.4.300.0030.00316.55
7.4.290.0070.00016.63
7.4.280.0080.00016.60
7.4.270.0070.00016.61
7.4.260.0030.00313.20
7.4.250.0030.00516.56
7.4.240.0000.00716.71
7.4.230.0030.00316.78
7.4.220.0130.00316.54
7.4.210.0100.00716.71
7.4.200.0030.00316.50
7.4.190.0020.00516.50
7.4.160.0110.00616.41
7.4.150.0090.01217.40
7.4.140.0130.00617.86
7.4.130.0170.00216.69
7.4.120.0120.00616.61
7.4.110.0070.01116.75
7.4.100.0030.01316.73
7.4.90.0090.01316.45
7.4.80.0100.00619.39
7.4.70.0030.01216.54
7.4.60.0140.00716.75
7.4.50.0090.00016.79
7.4.40.0060.00922.77
7.4.30.0140.00316.57
7.4.00.0070.00715.10
7.3.330.0000.00613.39
7.3.320.0030.00313.27
7.3.310.0030.00316.50
7.3.300.0030.00316.42
7.3.290.0110.00716.37
7.3.280.0090.00616.42
7.3.270.0130.00317.40
7.3.260.0080.01018.24
7.3.250.0110.00616.60
7.3.240.0060.01216.65
7.3.230.0100.00716.39
7.3.210.0070.01016.66
7.3.200.0090.00919.39
7.3.190.0100.01216.61
7.3.180.0130.00316.58
7.3.170.0070.01816.51
7.3.160.0090.00616.45
7.3.120.0000.01515.28
7.3.10.0090.00916.43
7.3.00.0120.00716.51
7.2.330.0040.01416.68
7.2.320.0150.00916.53
7.2.310.0120.01217.03
7.2.300.0000.01816.88
7.2.290.0120.00316.83
7.2.130.0090.00916.72
7.2.120.0060.01117.02
7.2.110.0120.00816.90
7.2.100.0140.00916.94
7.2.90.0100.01216.97
7.2.80.0170.00916.86
7.2.70.0130.01216.88
7.2.60.0120.00716.87
7.2.50.0150.00716.85
7.2.40.0120.00516.99
7.2.30.0070.01216.69
7.2.20.0110.00616.92
7.2.10.0070.01016.77
7.2.00.0070.01017.87
7.1.250.0120.00315.95
7.1.240.0070.00715.92
7.1.230.0140.00015.73
7.1.220.0000.01515.76
7.1.210.0040.00715.70
7.1.200.0030.00616.07
7.1.190.0120.00015.59
7.1.180.0060.00615.99
7.1.170.0060.00716.06
7.1.160.0040.00815.64
7.1.150.0070.00715.61
7.1.140.0040.01116.00
7.1.130.0040.01215.69
7.1.120.0080.00015.96
7.1.110.0060.00915.88
7.1.100.0040.00917.05
7.1.90.0040.00715.87
7.1.80.0080.00816.09
7.1.70.0020.00816.69
7.1.60.0060.01217.57
7.1.50.0060.00816.40
7.1.40.0000.01115.86
7.1.30.0060.00615.75
7.1.20.0110.00416.00
7.1.10.0040.00815.84
7.1.00.0030.04019.18
7.0.330.0060.00315.46
7.0.320.0080.00815.50
7.0.310.0000.01215.54
7.0.300.0030.01015.59
7.0.290.0030.00515.43
7.0.280.0000.00815.47
7.0.270.0070.00715.56
7.0.260.0030.00915.16
7.0.250.0030.00715.43
7.0.240.0070.01015.50
7.0.230.0100.00315.23
7.0.220.0000.01415.64
7.0.210.0140.00015.55
7.0.200.0070.00716.21
7.0.190.0060.00615.54
7.0.180.0030.00915.68
7.0.170.0000.01115.15
7.0.160.0070.00715.54
7.0.150.0070.00715.59
7.0.140.0020.04118.67
7.0.130.0100.00315.61
7.0.120.0080.00015.17
7.0.110.0080.00015.44
7.0.100.0200.04017.78
7.0.90.0130.02717.80
7.0.80.0200.04317.77
7.0.70.0210.03517.73
7.0.60.0170.04017.73
7.0.50.0200.01717.85
7.0.40.0070.03516.81
7.0.30.0040.02216.92
7.0.20.0050.04016.67
7.0.10.0080.01816.76
7.0.00.0080.04416.92
5.6.380.0000.01114.51
5.6.370.0000.00814.43
5.6.360.0030.00914.34
5.6.350.0040.00414.61
5.6.340.0030.01214.75
5.6.330.0100.00314.47
5.6.320.0030.00914.70
5.6.310.0000.01514.75
5.6.300.0070.00714.44
5.6.290.0060.00614.34
5.6.280.0070.03917.71
5.6.270.0030.00614.52
5.6.260.0070.00714.33
5.6.250.0060.04417.58
5.6.240.0050.04217.58
5.6.230.0060.04617.52
5.6.220.0050.02517.60
5.6.210.0070.03717.58
5.6.200.0030.02417.73
5.6.190.0060.02517.74
5.6.180.0080.02017.71
5.6.170.0050.02217.74
5.6.160.0070.04217.58
5.6.150.0100.04017.80
5.6.140.0100.04017.88
5.6.130.0000.04917.80
5.6.120.0050.04717.91
5.6.110.0050.04617.78
5.6.100.0050.04217.81
5.6.90.0100.03717.83
5.6.80.0050.02217.36
5.6.70.0120.03517.40
5.6.60.0050.04617.49
5.6.50.0080.04317.33
5.6.40.0100.04017.40
5.6.30.0040.02017.35
5.6.20.0100.03717.55
5.6.10.0100.03217.43
5.6.00.0030.03717.46
5.5.380.0050.03715.84
5.5.370.0000.04515.86
5.5.360.0020.02315.74
5.5.350.0100.03615.90
5.5.340.0020.02216.17
5.5.330.0030.02515.98
5.5.320.0020.02216.09
5.5.310.0020.03016.09
5.5.300.0090.02716.12
5.5.290.0030.04516.05
5.5.280.0050.03715.99
5.5.270.0070.04016.22
5.5.260.0040.02615.99
5.5.250.0050.03815.94
5.5.240.0050.04115.71
5.5.230.0080.04215.59
5.5.220.0070.03515.68
5.5.210.0040.04215.70
5.5.200.0050.04215.73
5.5.190.0020.02315.80
5.5.180.0080.01815.66
5.5.170.0040.00411.39
5.5.160.0100.03815.77
5.5.150.0030.03115.71
5.5.140.0100.03915.57
5.5.130.0030.02315.74
5.5.120.0020.04415.82
5.5.110.0080.03815.60
5.5.100.0060.02915.58
5.5.90.0070.03915.76
5.5.80.0070.02415.62
5.5.70.0060.03415.70
5.5.60.0050.03715.60
5.5.50.0080.02915.69
5.5.40.0050.03715.43
5.5.30.0030.03815.71
5.5.20.0080.03815.51
5.5.10.0030.02815.63
5.5.00.0070.04315.73
5.4.450.0040.02315.10
5.4.440.0060.04515.38
5.4.430.0060.03315.31
5.4.420.0050.03815.27
5.4.410.0020.04115.20
5.4.400.0050.04215.00
5.4.390.0050.02514.93
5.4.380.0080.02215.19
5.4.370.0050.01815.07
5.4.360.0030.04215.24
5.4.350.0000.03415.01
5.4.340.0070.04015.11
5.4.330.0100.00010.96
5.4.320.0060.03115.22
5.4.310.0030.04315.04
5.4.300.0030.04514.84
5.4.290.0030.03015.00
5.4.280.0050.04214.97
5.4.270.0020.04414.95
5.4.260.0060.03815.12
5.4.250.0050.03815.00
5.4.240.0040.04315.16
5.4.230.0020.02515.07
5.4.220.0040.02814.90
5.4.210.0060.03515.07
5.4.200.0050.02015.11
5.4.190.0030.03814.95
5.4.180.0050.04214.97
5.4.170.0050.03214.90
5.4.160.0070.04015.00
5.4.150.0070.03615.00
5.4.140.0050.01913.69
5.4.130.0050.03513.81
5.4.120.0020.04013.72
5.4.110.0050.02313.84
5.4.100.0030.02013.79
5.4.90.0020.02313.74
5.4.80.0020.04313.82
5.4.70.0020.02013.75
5.4.60.0020.04213.62
5.4.50.0050.02613.68
5.4.40.0060.03613.78
5.4.30.0030.01813.68
5.4.20.0050.02013.74
5.4.10.0040.01913.70
5.4.00.0050.04013.53
5.3.290.0030.03012.79
5.3.280.0020.03712.74
5.3.270.0050.04212.77
5.3.260.0030.04712.69
5.3.250.0000.02212.77
5.3.240.0020.04312.70
5.3.230.0000.02312.69
5.3.220.0050.03812.73
5.3.210.0020.04412.74
5.3.200.0080.01512.66
5.3.190.0050.04112.72
5.3.180.0070.01812.73
5.3.170.0050.03612.67
5.3.160.0050.02712.74
5.3.150.0050.02212.73
5.3.140.0060.03812.73
5.3.130.0040.01912.74
5.3.120.0030.03212.71
5.3.110.0080.04012.72
5.3.100.0040.03712.45
5.3.90.0070.02212.44
5.3.80.0070.03912.40
5.3.70.0020.04012.46
5.3.60.0050.03512.34
5.3.50.0020.04412.38
5.3.40.0070.03712.43
5.3.30.0020.04412.39
5.3.20.0050.03712.29
5.3.10.0090.03712.27
5.3.00.0050.04012.26
5.2.170.0040.01511.81
5.2.160.0040.03311.81
5.2.150.0000.01811.81
5.2.140.0040.02311.81
5.2.130.0040.03311.81
5.2.120.0070.02211.81
5.2.110.0030.03111.81
5.2.100.0000.02211.81
5.2.90.0080.01311.81
5.2.80.0050.01811.81
5.2.70.0000.02511.81
5.2.60.0050.03411.81
5.2.50.0030.02311.81
5.2.40.0050.01511.81
5.2.30.0000.03711.81
5.2.20.0030.03011.81
5.2.10.0050.01811.81
5.2.00.0030.02111.81
5.1.60.0050.02711.81
5.1.50.0070.02611.81
5.1.40.0030.02811.81
5.1.30.0020.01411.81
5.1.20.0060.02311.81
5.1.10.0000.02911.81
5.1.00.0030.02811.81
5.0.50.0020.02511.81
5.0.40.0070.02011.81
5.0.30.0030.03111.81
5.0.20.0030.01711.81
5.0.10.0050.01511.81
5.0.00.0040.01311.81
4.4.90.0050.01711.81
4.4.80.0050.01411.81
4.4.70.0040.00811.81
4.4.60.0020.00911.81
4.4.50.0000.01411.81
4.4.40.0050.02411.81
4.4.30.0000.02211.81
4.4.20.0000.02111.81
4.4.10.0030.01711.81
4.4.00.0060.02611.81
4.3.110.0010.02111.81
4.3.100.0020.02111.81
4.3.90.0030.01511.81
4.3.80.0000.03011.81
4.3.70.0020.01811.81
4.3.60.0030.01811.81
4.3.50.0000.01711.81
4.3.40.0020.01011.81
4.3.30.0020.01711.81
4.3.20.0020.01911.81
4.3.10.0010.01811.81
4.3.00.0040.00511.81

preferences:
53.81 ms | 400 KiB | 5 Q