3v4l.org

run code in 300+ PHP versions simultaneously
<?php // plugin_portswitch -> PluginPortswitchPortswitch // + extends CommonDBTM class PluginPortswitchPortswitch { public static $config_data; public static function loadConfig() { self::$config_data = parse_ini_file(GLPI_ROOT."/files/_plugins/portswitch/config.ini", true); } public static function drawInfoBox() { include_once(GLPI_ROOT."/inc/includes.php"); if(Session::haveRight("user", "w")) { echo "<tr><td class='top' width='450px'>"; echo "<br><table class='tab_cadrehov'><tr><th colspan=\"4\"><a href=\"/glpi/plugins/portswitch/\">Portswitch</a></th></tr>"; echo "<tr><th>Bezeichnung</th><th>Status</th></tr>"; self::loadConfig(); for($i = 0; $i < sizeof(self::$config_data); $i++) { echo "<tr><center>"; if(self::$config_data[$i]['status'] == "Aktiviert") { echo "<td>".self::$config_data[$i]['name']."</td><td>".self::getHtmlStatus($i)." ( "; $kommentar_array = explode(",", self::$config_data[$i]['kommentar']); for($j = 0; $j < sizeof($kommentar_array); $j++) echo "<a href=\"/glpi/front/ticket.form.php?id=".$kommentar_array[$j]."\"> #".$kommentar_array[$j]."</a>"; echo " ) </td>"; } else { echo "<td>".self::$config_data[$i]['name']."</td><td>".self::getHtmlStatus($i)."</td>"; } echo "</tr></center>"; } echo "</table>"; echo "</td></tr>"; } } public static function getHtmlStatus($id) { if(self::$config_data[$id]['status'] == "Aktiviert") return "<font color=\"#00FF00\">Aktiv</font>"; else if(self::$config_data[$id]['status'] == "Deaktiviert") return "<font color=\"#FF0000\">Inaktiv</font>"; else return "<font color=\"#0000FF\">Unbekannt</font>"; } public static function saveConfig() { $config_file = fopen(GLPI_ROOT."/files/_plugins/portswitch/config.ini", 'w'); if($config_file == false) die("Konnte ".GLPI_ROOT."/files/_plugins/portswitch/config.ini nicht schreiben."); for($i = 0; $i < sizeof(self::$config_data); $i++) { fwrite($config_file, "[$i]\n"); fwrite($config_file, "name = \"".self::$config_data[$i]['name']."\"\n"); fwrite($config_file, "ip = \"".self::$config_data[$i]['ip']."\"\n"); fwrite($config_file, "port = \"".self::$config_data[$i]['port']."\"\n"); fwrite($config_file, "kommentar = \"".self::$config_data[$i]['kommentar']."\"\n"); fwrite($config_file, "status = \"".self::$config_data[$i]['status']."\"\n"); fwrite($config_file, "passwort = \"".self::$config_data[$i]['passwort']."\"\n"); fwrite($config_file, "stack = \"".self::$config_data[$i]['stack']."\"\n"); fwrite($config_file, "hostname = \"".self::$config_data[$i]['hostname']."\"\n"); fwrite($config_file, "link = \"".self::$config_data[$i]['link']."\"\n\n"); } fclose($config_file); } }; ?>

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.00616.88
8.3.50.0120.01022.10
8.3.40.0040.01118.59
8.3.30.0140.00019.09
8.3.20.0040.01120.39
8.3.10.0080.00023.66
8.3.00.0060.00319.21
8.2.180.0110.00418.09
8.2.170.0120.00322.96
8.2.160.0070.00720.40
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0030.00620.75
8.2.110.0060.00322.26
8.2.100.0080.00319.39
8.2.90.0000.00819.15
8.2.80.0080.00017.97
8.2.70.0050.00317.38
8.2.60.0000.00917.78
8.2.50.0090.00018.07
8.2.40.0080.00019.82
8.2.30.0050.00319.97
8.2.20.0040.00417.68
8.2.10.0070.00017.87
8.2.00.0060.00317.54
8.1.280.0080.00825.92
8.1.270.0040.01123.96
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.87
8.1.230.0060.00619.11
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0080.00616.86
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0050.00318.77
8.1.160.0040.00421.99
8.1.150.0060.00318.57
8.1.140.0040.00417.32
8.1.130.0030.00317.81
8.1.120.0040.00417.36
8.1.110.0000.00717.38
8.1.100.0040.00417.45
8.1.90.0040.00417.46
8.1.80.0040.00417.38
8.1.70.0000.00717.27
8.1.60.0040.00417.57
8.1.50.0080.00017.42
8.1.40.0090.00017.46
8.1.30.0050.00517.61
8.1.20.0000.00917.41
8.1.10.0050.00317.31
8.1.00.0000.00717.24
8.0.300.0080.00018.77
8.0.290.0040.00417.18
8.0.280.0070.00018.34
8.0.270.0030.00317.30
8.0.260.0060.00017.07
8.0.250.0030.00316.98
8.0.240.0040.00416.86
8.0.230.0050.00216.91
8.0.220.0030.00316.71
8.0.210.0080.00016.86
8.0.200.0000.00616.88
8.0.190.0040.00416.88
8.0.180.0080.00016.91
8.0.170.0040.00416.82
8.0.160.0040.00416.96
8.0.150.0000.00716.89
8.0.140.0000.00716.79
8.0.130.0000.00513.27
8.0.120.0000.00816.68
8.0.110.0040.00416.83
8.0.100.0040.00416.72
8.0.90.0000.00716.82
8.0.80.0090.00616.87
8.0.70.0000.00816.89
8.0.60.0050.00216.83
8.0.50.0040.00416.64
8.0.30.0120.01217.13
8.0.20.0120.00617.40
8.0.10.0070.00016.82
8.0.00.0080.01016.70
7.4.330.0000.00515.03
7.4.320.0000.00616.36
7.4.300.0050.00516.44
7.4.290.0030.00316.45
7.4.280.0060.00316.54
7.4.270.0070.00016.45
7.4.260.0000.00716.38
7.4.250.0070.00016.50
7.4.240.0020.00616.50
7.4.230.0000.00716.28
7.4.220.0030.01616.53
7.4.210.0040.01316.53
7.4.200.0040.00416.37
7.4.190.0070.00016.39
7.4.160.0060.00916.49
7.4.150.0070.01017.40
7.4.140.0080.00817.86
7.4.130.0050.01216.51
7.4.120.0100.00816.40
7.4.110.0160.00316.38
7.4.100.0150.00316.54
7.4.90.0120.00816.21
7.4.80.0130.00719.39
7.4.70.0130.00316.29
7.4.60.0090.00916.47
7.4.50.0060.00316.29
7.4.40.0100.01316.50
7.4.30.0060.01616.36
7.4.00.0110.00014.52
7.3.330.0030.00313.16
7.3.320.0000.00513.22
7.3.310.0000.00716.20
7.3.300.0000.00616.09
7.3.290.0070.01016.20
7.3.280.0090.01116.21
7.3.270.0130.00417.40
7.3.260.0170.00316.33
7.3.250.0130.00516.20
7.3.240.0090.00916.43
7.3.230.0100.00716.39
7.3.210.0130.00316.18
7.3.200.0070.01419.39
7.3.190.0040.01616.52
7.3.180.0140.00416.30
7.3.170.0110.00516.45
7.3.160.0060.00916.30
7.3.120.0130.00014.66
7.2.330.0070.01116.25
7.2.320.0060.01216.36
7.2.310.0140.00816.59
7.2.300.0140.00316.44
7.2.290.0130.00316.61
7.2.60.0140.00416.82
7.2.00.0060.00618.98
7.1.200.0100.00315.43
7.1.100.0000.01018.04
7.1.70.0030.00616.81
7.1.60.0060.01919.46
7.1.50.0070.01416.52
7.1.00.0030.07322.27
7.0.200.0040.00416.54
7.0.140.0100.06722.10
7.0.60.0200.07020.08
7.0.50.0070.06718.00
7.0.40.0070.05320.23
7.0.30.0330.07720.21
7.0.20.0300.04720.23
7.0.10.0230.04020.23
7.0.00.0070.07320.27
5.6.280.0070.07021.18
5.6.210.0100.05020.73
5.6.200.0070.04318.28
5.6.190.0070.09020.57
5.6.180.3500.04320.56
5.6.170.0200.08320.55
5.6.160.0030.05320.54
5.6.150.0070.07318.18
5.6.140.0070.04018.21
5.6.130.0030.08318.21
5.6.120.0100.08321.14
5.6.110.0130.07021.00
5.6.100.0070.09020.97
5.6.90.0000.06321.14
5.6.80.0030.04020.43
5.6.70.0300.05020.39
5.5.350.0230.07320.44
5.5.340.0000.08017.95
5.5.330.0130.09020.43
5.5.320.0370.04320.31
5.5.310.0270.07320.33
5.5.300.0130.05317.99
5.5.290.0030.05317.99
5.5.280.0100.08720.93
5.5.270.0100.08020.79
5.5.260.0170.07320.90
5.5.250.0100.07320.64
5.5.240.0100.05320.18
5.4.450.0930.06319.59
5.4.440.0870.05719.21
5.4.430.1130.07319.16
5.4.420.0630.00019.39
5.4.410.0070.06319.04
5.4.400.0270.04318.55
5.4.390.0230.05018.80
5.4.380.0170.05718.80
5.4.370.0070.04018.77
5.4.360.0070.04018.75
5.4.350.0090.03912.04
5.4.340.0080.03212.04
5.4.320.0060.03912.53
5.4.310.0050.04312.53
5.4.300.0060.03712.53
5.4.290.0060.04112.52
5.4.280.0040.03712.42
5.4.270.0070.04212.42
5.4.260.0120.06512.43
5.4.250.0070.04512.42
5.4.240.0180.10512.42
5.4.230.0130.09112.41
5.4.220.0090.08112.41
5.4.210.0080.10312.41
5.4.200.0180.08512.41
5.4.190.0110.10012.41
5.4.180.0190.06512.41
5.4.170.0060.04212.42
5.4.160.0040.04312.41
5.4.150.0140.05712.41
5.4.140.0100.04312.10
5.4.130.0120.04512.08
5.4.120.0420.13412.04
5.4.110.0190.05312.04
5.4.100.0300.09112.04
5.4.90.0140.07212.04
5.4.80.0060.04112.04
5.4.70.0120.06412.04
5.4.60.0280.15312.03
5.4.50.0090.09012.03
5.4.40.0130.06412.02
5.4.30.0080.04012.01
5.4.20.0120.06212.02
5.4.10.0090.06112.02
5.4.00.0110.04211.50
5.3.290.0080.04712.80
5.3.280.0130.09812.71
5.3.270.0070.05812.73
5.3.260.0060.05512.72
5.3.250.0060.03912.72
5.3.240.0080.05412.72
5.3.230.0070.04212.71
5.3.220.0080.04212.68
5.3.210.0080.04512.68
5.3.200.0080.04912.68
5.3.190.0050.04412.68
5.3.180.0080.04212.67
5.3.170.0080.05312.68
5.3.160.0180.06212.68
5.3.150.0160.07212.67
5.3.140.0120.06812.66
5.3.130.0090.04212.66
5.3.120.0140.06612.66
5.3.110.0150.04512.66
5.3.100.0110.03912.15
5.3.90.0140.04312.13
5.3.80.0100.04612.12
5.3.70.0150.08112.12
5.3.60.0090.05512.11
5.3.50.0070.05512.06
5.3.40.0130.05212.05
5.3.30.0140.07312.01
5.3.20.0100.05111.79
5.3.10.0080.05211.76
5.3.00.0140.08211.75
5.2.170.0110.0679.26
5.2.160.0120.0859.26
5.2.150.0080.0669.25
5.2.140.0120.0709.25
5.2.130.0140.0619.21
5.2.120.0100.0749.21
5.2.110.0090.0489.21
5.2.100.0060.0599.21
5.2.90.0120.0499.21
5.2.80.0130.0589.21
5.2.70.0200.0779.21
5.2.60.0170.0669.16
5.2.50.0200.0879.13
5.2.40.0020.0689.11
5.2.30.0110.0749.08
5.2.20.0090.0399.07
5.2.10.0070.0398.98
5.2.00.0090.0448.84
5.1.60.0030.0398.14
5.1.50.0060.0328.13
5.1.40.0090.0858.11
5.1.30.0040.0418.45
5.1.20.0070.0408.48
5.1.10.0090.0328.20
5.1.00.0040.0268.20
5.0.50.0050.0196.69
5.0.40.0050.0176.54
5.0.30.0030.0316.36
5.0.20.0040.0196.32
5.0.10.0050.0196.30
5.0.00.0030.0396.30
4.4.90.0050.0204.78
4.4.80.0030.0224.75
4.4.70.0040.0214.75
4.4.60.0030.0214.76
4.4.50.0070.0284.77
4.4.40.0060.0304.71
4.4.30.0050.0194.76
4.4.20.0060.0194.85
4.4.10.0060.0204.85
4.4.00.0030.0364.76
4.3.110.0050.0244.66
4.3.100.0060.0224.67
4.3.90.0040.0204.64
4.3.80.0020.0334.58
4.3.70.0050.0204.63
4.3.60.0060.0184.63
4.3.50.0030.0194.63
4.3.40.0040.0254.53
4.3.30.0050.0163.30
4.3.20.0020.0173.28
4.3.10.0040.0183.24
4.3.00.0130.0276.68

preferences:
49.88 ms | 401 KiB | 5 Q