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 = '1989;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"; } } } 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.0140.00018.30
8.3.50.0090.01121.14
8.3.40.0130.01018.84
8.3.30.0160.00318.93
8.3.20.0060.00318.73
8.3.10.0040.00421.08
8.3.00.0040.00421.62
8.2.180.0090.00916.75
8.2.170.0040.01122.96
8.2.160.0160.00320.39
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0040.00419.79
8.2.110.0030.00622.25
8.2.100.0110.00017.91
8.2.90.0040.00419.35
8.2.80.0050.00318.16
8.2.70.0030.00617.50
8.2.60.0050.00318.03
8.2.50.0040.00818.07
8.2.40.0030.00518.16
8.2.30.0000.00819.58
8.2.20.0040.00417.80
8.2.10.0080.00017.84
8.2.00.0030.00617.70
8.1.280.0100.00625.92
8.1.270.0070.00023.99
8.1.260.0080.00526.35
8.1.250.0100.00028.09
8.1.240.0060.00322.64
8.1.230.0040.00821.04
8.1.220.0040.00418.77
8.1.210.0000.00918.95
8.1.200.0030.00617.23
8.1.190.0050.00317.52
8.1.180.0040.00418.10
8.1.170.0030.00518.49
8.1.160.0070.00018.82
8.1.150.0020.00518.71
8.1.140.0040.00417.47
8.1.130.0030.00317.87
8.1.120.0000.01017.51
8.1.110.0040.00417.46
8.1.100.0070.00017.48
8.1.90.0000.00717.43
8.1.80.0040.00417.39
8.1.70.0000.00717.39
8.1.60.0000.00917.52
8.1.50.0000.00917.46
8.1.40.0050.00317.50
8.1.30.0080.00017.66
8.1.20.0040.00417.53
8.1.10.0000.00717.59
8.1.00.0000.00817.53
8.0.300.0070.00419.80
8.0.290.0000.00717.18
8.0.280.0000.00718.47
8.0.270.0000.00817.36
8.0.260.0000.00816.79
8.0.250.0040.00416.98
8.0.240.0090.00017.02
8.0.230.0030.00316.87
8.0.220.0000.00716.93
8.0.210.0030.00316.94
8.0.200.0000.00717.02
8.0.190.0020.00516.92
8.0.180.0000.00816.91
8.0.170.0000.00716.93
8.0.160.0040.00416.99
8.0.150.0000.00816.89
8.0.140.0020.00516.77
8.0.130.0000.00613.38
8.0.120.0030.00516.83
8.0.110.0070.00016.96
8.0.100.0000.00816.88
8.0.90.0000.00716.75
8.0.80.0000.01516.93
8.0.70.0030.00516.99
8.0.60.0050.00216.97
8.0.50.0070.00016.75
8.0.30.0140.00517.18
8.0.20.0070.01117.40
8.0.10.0050.00216.92
8.0.00.0100.01016.73
7.4.330.0030.00314.83
7.4.320.0030.00316.52
7.4.300.0030.00316.52
7.4.290.0000.00716.55
7.4.280.0000.00716.42
7.4.270.0000.00716.67
7.4.260.0030.00313.20
7.4.250.0080.00016.50
7.4.240.0000.00716.46
7.4.230.0030.00316.73
7.4.220.0190.00616.60
7.4.210.0070.00816.59
7.4.200.0030.00316.62
7.4.190.0030.00316.70
7.4.160.0120.00416.36
7.4.150.0110.00617.40
7.4.140.0160.00517.86
7.4.130.0020.01516.51
7.4.120.0090.00916.46
7.4.110.0090.00916.58
7.4.100.0090.00916.57
7.4.90.0140.00416.38
7.4.80.0100.00719.39
7.4.70.0090.00616.45
7.4.60.0040.01316.57
7.4.50.0030.00616.48
7.4.40.0030.01022.52
7.4.30.0060.00916.68
7.4.00.0030.01414.94
7.3.330.0000.00513.11
7.3.320.0020.00313.26
7.3.310.0030.00316.32
7.3.300.0030.00316.35
7.3.290.0030.01716.38
7.3.280.0090.00916.39
7.3.270.0160.00317.40
7.3.260.0110.00618.24
7.3.250.0130.00816.37
7.3.240.0130.01016.44
7.3.230.0130.00316.50
7.3.210.0120.00616.33
7.3.200.0090.01419.39
7.3.190.0150.00716.60
7.3.180.0100.00716.50
7.3.170.0060.01116.42
7.3.160.0100.00616.61
7.3.120.0070.00314.92
7.3.10.0120.00516.27
7.3.00.0070.00816.58
7.2.330.0060.01216.55
7.2.320.0090.00916.52
7.2.310.0060.01316.86
7.2.300.0110.00616.54
7.2.290.0150.00316.79
7.2.130.0070.00916.88
7.2.120.0070.00816.80
7.2.110.0060.01016.70
7.2.100.0060.00816.53
7.2.90.0070.00817.06
7.2.80.0070.00816.93
7.2.70.0070.01016.83
7.2.60.0080.00616.81
7.2.50.0070.00816.62
7.2.40.0060.00816.80
7.2.30.0070.00716.74
7.2.20.0100.00716.72
7.2.10.0070.00916.70
7.2.00.0090.00617.42
7.1.250.0090.00915.74
7.1.240.0030.00715.63
7.1.230.0030.00715.66
7.1.220.0030.00715.80
7.1.210.0030.00915.76
7.1.200.0090.00415.78
7.1.190.0030.00915.50
7.1.180.0030.00615.77
7.1.170.0070.00715.77
7.1.160.0040.00815.82
7.1.150.0030.00715.99
7.1.140.0070.00015.67
7.1.130.0090.00615.76
7.1.120.0000.00815.93
7.1.110.0100.00315.75
7.1.100.0040.00716.81
7.1.90.0040.00415.58
7.1.80.0060.00615.81
7.1.70.0030.00616.40
7.1.60.0100.00717.61
7.1.50.0090.00816.44
7.1.40.0070.00315.77
7.1.30.0000.01615.61
7.1.20.0100.00715.64
7.1.10.0000.01315.59
7.1.00.0030.04319.17
7.0.330.0030.00615.51
7.0.320.0040.00815.15
7.0.310.0030.00715.61
7.0.300.0090.00315.11
7.0.290.0030.00615.23
7.0.280.0060.00315.39
7.0.270.0060.00615.42
7.0.260.0070.00715.60
7.0.250.0030.00915.43
7.0.240.0070.00315.49
7.0.230.0040.00815.22
7.0.220.0070.00015.37
7.0.210.0000.00815.41
7.0.200.0050.00516.16
7.0.190.0030.00715.44
7.0.180.0000.01515.37
7.0.170.0040.00415.13
7.0.160.0040.01115.20
7.0.150.0040.00815.36
7.0.140.0030.04118.73
7.0.130.0080.00415.33
7.0.120.0080.00615.18
7.0.110.0070.00715.45
7.0.100.0330.04217.55
7.0.90.0020.03217.71
7.0.80.0080.04217.87
7.0.70.0080.03617.71
7.0.60.0050.02517.64
7.0.50.0070.02717.88
7.0.40.0100.04016.88
7.0.30.0050.04716.71
7.0.20.0100.04316.88
7.0.10.0080.04316.85
7.0.00.0120.03816.64
5.6.380.0040.00714.48
5.6.370.0000.01214.60
5.6.360.0040.00714.34
5.6.350.0030.00913.94
5.6.340.0070.00714.26
5.6.330.0000.01214.00
5.6.320.0040.00814.57
5.6.310.0060.00314.71
5.6.300.0060.00614.49
5.6.290.0060.00614.59
5.6.280.0060.00914.55
5.6.270.0040.00714.29
5.6.260.0090.00314.54
5.6.250.0020.05017.58
5.6.240.0070.04217.62
5.6.230.0040.02917.54
5.6.220.0050.04117.53
5.6.210.0070.02717.42
5.6.200.0070.04317.67
5.6.190.0020.04617.67
5.6.180.0070.03517.83
5.6.170.0070.03017.66
5.6.160.0060.04317.59
5.6.150.0050.04217.63
5.6.140.0120.02217.62
5.6.130.0030.02817.67
5.6.120.0060.05017.76
5.6.110.0050.02517.75
5.6.100.0130.03317.80
5.6.90.0070.02817.66
5.6.80.0130.03617.37
5.6.70.0020.02817.33
5.6.60.0050.02617.45
5.6.50.0070.03817.52
5.6.40.0080.03817.31
5.6.30.0100.02217.31
5.6.20.0110.02017.54
5.6.10.0060.04017.51
5.6.00.0080.04817.30
5.5.380.0050.03815.82
5.5.370.0050.03615.99
5.5.360.0120.02715.64
5.5.350.0020.02815.91
5.5.340.0030.03215.96
5.5.330.0100.03115.88
5.5.320.0050.02816.13
5.5.310.0070.04216.14
5.5.300.0060.03616.11
5.5.290.0020.02615.96
5.5.280.0050.04715.96
5.5.270.0020.02515.93
5.5.260.0050.03815.70
5.5.250.0030.03015.72
5.5.240.0080.03215.76
5.5.230.0020.02815.48
5.5.220.0050.03715.77
5.5.210.0120.03715.74
5.5.200.0110.03315.74
5.5.190.0050.02415.72
5.5.180.0020.04415.69
5.5.170.0030.00711.21
5.5.160.0040.02915.71
5.5.150.0060.04415.77
5.5.140.0050.04015.74
5.5.130.0010.03415.64
5.5.120.0070.04215.66
5.5.110.0050.04215.69
5.5.100.0050.02415.54
5.5.90.0080.02115.54
5.5.80.0020.02715.71
5.5.70.0030.02615.74
5.5.60.0120.03315.45
5.5.50.0060.04515.67
5.5.40.0070.02215.66
5.5.30.0030.04015.69
5.5.20.0050.04315.60
5.5.10.0090.04015.57
5.5.00.0050.04215.46
5.4.450.0060.03115.19
5.4.440.0030.04415.30
5.4.430.0070.02215.10
5.4.420.0050.04115.27
5.4.410.0130.03215.15
5.4.400.0050.03714.91
5.4.390.0050.03215.06
5.4.380.0120.03714.98
5.4.370.0030.02315.03
5.4.360.0030.02414.95
5.4.350.0050.04215.02
5.4.340.0070.04215.17
5.4.330.0070.00010.75
5.4.320.0040.04514.96
5.4.310.0040.04214.81
5.4.300.0050.03814.97
5.4.290.0110.03715.05
5.4.280.0070.02515.07
5.4.270.0050.04415.00
5.4.260.0060.02415.12
5.4.250.0090.03614.98
5.4.240.0080.02815.07
5.4.230.0020.02415.18
5.4.220.0090.03815.16
5.4.210.0070.03414.90
5.4.200.0070.03015.09
5.4.190.0060.02915.00
5.4.180.0030.04715.06
5.4.170.0080.03714.96
5.4.160.0020.03014.96
5.4.150.0070.02014.90
5.4.140.0080.02313.71
5.4.130.0060.04013.69
5.4.120.0030.04113.59
5.4.110.0050.02913.58
5.4.100.0120.03013.66
5.4.90.0050.03713.66
5.4.80.0060.03813.61
5.4.70.0020.03713.73
5.4.60.0070.02313.77
5.4.50.0050.03713.50
5.4.40.0100.03213.71
5.4.30.0050.03713.62
5.4.20.0040.04013.68
5.4.10.0060.03613.58
5.4.00.0050.03813.44
5.3.290.0030.04212.64
5.3.280.0070.02012.55
5.3.270.0020.04512.45
5.3.260.0080.02512.52
5.3.250.0080.03512.56
5.3.240.0020.03212.49
5.3.230.0080.03812.42
5.3.220.0060.03912.45
5.3.210.0030.04212.50
5.3.200.0050.04012.43
5.3.190.0060.02212.45
5.3.180.0110.01412.64
5.3.170.0020.04012.50
5.3.160.0030.04112.57
5.3.150.0070.03412.51
5.3.140.0060.03812.52
5.3.130.0060.03012.62
5.3.120.0070.02212.56
5.3.110.0060.01612.51
5.3.100.0020.04312.33
5.3.90.0050.01812.29
5.3.80.0030.04212.16
5.3.70.0030.04212.19
5.3.60.0000.03912.25
5.3.50.0070.03312.09
5.3.40.0030.03912.16
5.3.30.0080.03612.08
5.3.20.0060.03811.98
5.3.10.0060.02311.80
5.3.00.0020.02911.92
5.2.170.0080.02510.53
5.2.160.0060.02810.54
5.2.150.0080.03010.57
5.2.140.0000.03810.48
5.2.130.0020.03310.46
5.2.120.0030.03110.58
5.2.110.0030.01710.56
5.2.100.0050.03010.43
5.2.90.0100.02510.58
5.2.80.0070.03210.53
5.2.70.0030.02110.51
5.2.60.0070.03210.52
5.2.50.0050.02510.50
5.2.40.0050.01710.42
5.2.30.0030.01610.43
5.2.20.0000.03010.46
5.2.10.0020.02610.38
5.2.00.0080.03010.38
5.1.60.0000.02310.17
5.1.50.0040.01810.17
5.1.40.0020.01510.17
5.1.30.0030.01710.17
5.1.20.0050.02510.19
5.1.10.0050.02510.17
5.1.00.0030.01710.17
5.0.50.0050.02310.17
5.0.40.0020.01910.17
5.0.30.0020.02810.17
5.0.20.0030.01210.17
5.0.10.0000.02610.17
5.0.00.0080.02510.17
4.4.90.0050.01810.17
4.4.80.0010.01910.17
4.4.70.0020.02010.17
4.4.60.0020.01210.17
4.4.50.0030.01010.17
4.4.40.0000.03110.17
4.4.30.0010.02110.17
4.4.20.0050.00910.17
4.4.10.0030.01810.17
4.4.00.0000.03110.17
4.3.110.0020.00810.17
4.3.100.0010.01110.17
4.3.90.0020.01210.17
4.3.80.0050.02510.17
4.3.70.0000.01710.17
4.3.60.0020.02010.17
4.3.50.0030.01710.17
4.3.40.0030.02510.17
4.3.30.0030.01210.17
4.3.20.0020.02010.17
4.3.10.0020.02010.17
4.3.00.0030.01110.17

preferences:
51.94 ms | 400 KiB | 5 Q