3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('GLPI_ROOT', '../../..'); if(!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } // plugin_portswitch -> PluginPortswitchPortswitch // + extends CommonDBTM class PluginPortswitchPortswitch extends CommonDBTM { 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); } }; // Status aktualisieren if (isset($_SESSION['port_changed'])) { $changed = $_SESSION['port_changed']; unset($_SESSION['port_changed']); if(PluginPortswitchPortswitch::$config_data[$changed]['link'] != '0.0.0.0') { PluginPortswitchPortswitch::$config_data[$changed]['link'] = exec('../scripts/checkport.sh '.PluginPortswitchPortswitch::$config_data[$changed]['ip'].' '.PluginPortswitchPortswitch::$config_data[$changed]['port'].' '.PluginPortswitchPortswitch::$config_data[$changed]['passwort'].' '.PluginPortswitchPortswitch::$config_data[$changed]['stack'].' '.PluginPortswitchPortswitch::$config_data[$changed]['hostname']); } else { PluginPortswitchPortswitch::$config_data[$changed]['link'] = 'Konnte nicht abgefragt werden. (Konfiguration prüfen!)'; } PluginPortswitchPortswitch::saveConfig(); } for($i = 0; $i < sizeof(PluginPortswitchPortswitch::$config_data); $i++) { ?> <h1><?php echo PluginPortswitchPortswitch::$config_data[$i]['name']; ?> auf Switch <?php echo PluginPortswitchPortswitch::$config_data[$i]['hostname']; ?>:<?php echo PluginPortswitchPortswitch::$config_data[$i]['port']; ?> Kontrolle</h1> <form method="POST" action="<?php echo GLPI_ROOT; ?>/plugins/portswitch/front/portswitch.form.php"> <p> Ticketnummern (mit Komma trennen, z.B. <i>"1024,2048,..."</i>: <input type="text" name="kommentar" value="<?php echo PluginPortswitchPortswitch::$config_data[$i]['kommentar']; ?>"><br> <input type="submit" name="Aktualisieren" value="Aktualisieren"> </p> <p> <input type="hidden" name="sent" value="<?php echo $i; ?>"> <input type="submit" name="deactivate" value="Deaktivieren"> <input type="submit" name="activate" value="Aktivieren"> </p> <p>&nbsp;</p> <p> <?php switch(PluginPortswitchPortswitch::$config_data[$i]['link']) { case 'Down': $color = '#FF0000'; break; case 'Up': $color = '#00FF00'; break; default: $color = '#0000FF'; } ?> Port Link-Status: <span style="color:<?php echo $color; ?>"><?php echo PluginPortswitchPortswitch::$config_data[$i]['link']; ?></span><br> Port Status: <?php echo PluginPortswitchPortswitch::getHtmlStatus($i); ?><br><br> <input type="submit" name="link" value="Update Link Status"> </p> <?php Html::closeForm(); } ?>

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.0180.00416.88
8.3.50.0120.00322.04
8.3.40.0120.00318.67
8.3.30.0140.00419.11
8.3.20.0040.00420.04
8.3.10.0060.00323.51
8.3.00.0080.00019.11
8.2.180.0040.01118.67
8.2.170.0150.00022.96
8.2.160.0170.00020.60
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00819.39
8.2.110.0070.00321.05
8.2.100.0070.00417.96
8.2.90.0060.00317.78
8.2.80.0040.00717.97
8.2.70.0060.00317.88
8.2.60.0040.00417.91
8.2.50.0040.00418.07
8.2.40.0060.00319.94
8.2.30.0000.00718.38
8.2.20.0080.00017.84
8.2.10.0040.00418.18
8.2.00.0040.00417.86
8.1.280.0140.00725.92
8.1.270.0050.00322.31
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0140.00421.16
8.1.230.0060.00620.87
8.1.220.0040.00417.79
8.1.210.0060.00319.94
8.1.200.0040.00417.36
8.1.190.0040.00417.38
8.1.180.0040.00418.10
8.1.170.0030.00618.55
8.1.160.0050.00222.13
8.1.150.0030.00618.74
8.1.140.0000.00917.46
8.1.130.0040.00417.91
8.1.120.0040.00417.42
8.1.110.0070.00017.57
8.1.100.0080.00017.37
8.1.90.0080.00017.51
8.1.80.0040.00417.51
8.1.70.0040.00417.51
8.1.60.0040.00717.59
8.1.50.0030.00617.45
8.1.40.0080.00017.58
8.1.30.0030.00917.75
8.1.20.0000.00717.69
8.1.10.0040.00417.52
8.1.00.0000.00817.60
8.0.300.0040.00420.20
8.0.290.0070.00016.75
8.0.280.0000.00718.49
8.0.270.0000.00717.42
8.0.260.0040.00417.37
8.0.250.0030.00516.98
8.0.240.0040.00417.15
8.0.230.0040.00417.12
8.0.220.0030.00317.01
8.0.210.0000.00716.98
8.0.200.0040.00417.12
8.0.190.0040.00417.13
8.0.180.0050.00317.13
8.0.170.0040.00417.10
8.0.160.0000.01017.11
8.0.150.0000.00717.09
8.0.140.0040.00416.91
8.0.130.0030.00313.54
8.0.120.0080.00017.12
8.0.110.0000.00717.09
8.0.100.0080.00016.89
8.0.90.0030.00616.95
8.0.80.0090.01216.97
8.0.70.0080.00016.95
8.0.60.0040.00417.10
8.0.50.0070.00017.00
8.0.30.0090.01017.22
8.0.20.0070.01217.40
8.0.10.0000.00716.95
8.0.00.0110.00716.99
7.4.330.0000.00515.09
7.4.320.0000.00616.71
7.4.300.0070.00016.63
7.4.290.0030.00316.59
7.4.280.0040.00416.55
7.4.270.0070.00016.46
7.4.260.0030.00516.61
7.4.250.0040.00416.65
7.4.240.0020.00516.55
7.4.230.0000.00716.44
7.4.220.0090.00916.50
7.4.210.0030.01216.65
7.4.200.0070.00016.39
7.4.190.0000.00716.74
7.4.160.0060.00916.46
7.4.150.0060.01217.40
7.4.140.0060.01317.86
7.4.130.0100.00916.60
7.4.120.0110.00616.69
7.4.110.0060.01216.68
7.4.100.0030.01516.48
7.4.90.0100.01416.58
7.4.80.0210.00719.39
7.4.70.0110.00716.64
7.4.60.0120.00816.65
7.4.50.0000.00916.64
7.4.40.0090.00616.37
7.4.30.0060.01016.61
7.4.00.0060.01015.23
7.3.330.0060.00013.24
7.3.320.0000.00613.48
7.3.310.0040.00416.42
7.3.300.0000.00716.22
7.3.290.0110.00316.42
7.3.280.0080.00916.40
7.3.270.0070.01017.40
7.3.260.0150.00316.61
7.3.250.0080.01016.46
7.3.240.0120.00916.42
7.3.230.0160.00816.41
7.3.210.0070.01116.51
7.3.200.0180.00419.39
7.3.190.0100.01016.60
7.3.180.0060.01016.48
7.3.170.0070.01116.65
7.3.160.0100.00716.38
7.3.120.0030.01314.71
7.2.330.0140.00316.45
7.2.320.0060.01816.70
7.2.310.0090.00916.87
7.2.300.0070.01116.73
7.2.290.0110.00616.66
7.2.60.0130.00316.85
7.2.00.0090.00619.38
7.1.200.0040.01215.82
7.1.100.0320.00618.10
7.1.70.0030.01316.82
7.1.60.0130.01319.46
7.1.50.0160.00316.79
7.1.00.0030.07722.34
7.0.200.0000.00716.32
7.0.140.0030.07322.05
7.0.100.0170.07720.14
7.0.90.0270.06020.06
7.0.80.0300.04720.02
7.0.70.0100.07720.08
7.0.60.0230.08020.07
7.0.50.0000.09020.43
7.0.40.0100.07020.05
7.0.30.0130.08020.18
7.0.20.0170.07020.14
7.0.10.0200.07020.08
7.0.00.0170.06020.14
5.6.280.0030.07021.18
5.6.250.0130.07720.80
5.6.240.0100.08320.80
5.6.230.0200.06320.79
5.6.220.0030.09020.60
5.6.210.0200.06320.61
5.6.200.0030.08321.22
5.6.190.0030.04720.98
5.6.180.0070.08321.08
5.6.170.0030.05721.07
5.6.160.0070.04021.23
5.6.150.0130.05021.04
5.6.140.0030.05721.21
5.6.130.0030.06721.12
5.6.120.0070.08021.07
5.6.110.0100.07721.20
5.6.100.0030.06321.17
5.6.90.0100.07721.09
5.6.80.0070.08020.37
5.6.70.0070.04320.50
5.6.60.0200.06320.46
5.6.50.0070.07020.60
5.6.40.0100.07720.39
5.6.30.0030.05020.49
5.6.20.0130.04320.48
5.6.10.0100.07020.48
5.6.00.0100.07720.47
5.5.380.0070.04020.42
5.5.370.0030.07320.57
5.5.360.0030.07020.44
5.5.350.0030.05020.48
5.5.340.0070.07720.87
5.5.330.0100.07320.94
5.5.320.0130.08020.95
5.5.310.0100.08720.96
5.5.300.0170.07320.85
5.5.290.0130.08020.82
5.5.280.0070.08720.78
5.5.270.0070.09320.87
5.5.260.0070.08320.68
5.5.250.0030.08320.77
5.5.240.0130.07720.35
5.5.230.0100.08020.33
5.5.220.0070.07720.29
5.5.210.0170.05320.16
5.5.200.0030.07320.18
5.5.190.0030.07320.29
5.5.180.0170.07320.28
5.5.160.0100.08020.23
5.5.150.0100.07320.28
5.5.140.0100.07720.30
5.5.130.0100.06720.28
5.5.120.0070.08320.28
5.5.110.0130.07320.29
5.5.100.0170.03720.03
5.5.90.0070.08020.11
5.5.80.0070.07020.22
5.5.70.0200.06320.19
5.5.60.0100.06320.18
5.5.50.0000.08320.15
5.5.40.0070.07720.10
5.5.30.0130.07020.09
5.5.20.0200.07019.98
5.5.10.0070.07319.98
5.5.00.0000.04320.08
5.4.450.0130.07319.37
5.4.440.0070.08019.41
5.4.430.0100.07019.48
5.4.420.0100.07319.48
5.4.410.0070.08019.34
5.4.400.0070.05319.23
5.4.390.0100.07018.90
5.4.380.0130.06719.18
5.4.370.0100.07019.23
5.4.360.0070.07718.91
5.4.350.0130.07019.03
5.4.340.0070.07319.12
5.4.320.0030.07719.13
5.4.310.0030.07318.88
5.4.300.0100.04018.84
5.4.290.0070.07319.04
5.4.280.0070.04719.12
5.4.270.0030.08318.94
5.4.260.0100.07019.13
5.4.250.0070.08019.22
5.4.240.0030.06719.11
5.4.230.0100.04719.09
5.4.220.0200.07318.94
5.4.210.0030.04719.13
5.4.200.0000.08018.93
5.4.190.0070.04019.11
5.4.180.0070.05719.11
5.4.170.0130.06719.13
5.4.160.0070.04018.87
5.4.150.0070.04019.20
5.4.140.0030.03716.47
5.4.130.0030.03716.51
5.4.120.0000.04016.24
5.4.110.0070.05316.52
5.4.100.0000.04016.34
5.4.90.0100.03016.54
5.4.80.0100.03016.47
5.4.70.0100.02716.53
5.4.60.0000.04016.46
5.4.50.0100.05716.30
5.4.40.0030.03716.38
5.4.30.0070.03316.41
5.4.20.0070.03316.41
5.4.10.0030.07716.53
5.4.00.0170.05015.93
5.3.290.0070.07715.64
5.3.280.0200.06315.64
5.3.270.0030.08015.64
5.3.260.0070.06315.64
5.3.250.0030.04315.64
5.3.240.0070.04015.64
5.3.230.0030.04315.64
5.3.220.0070.03315.64
5.3.210.0170.02315.64
5.3.200.0100.03015.64
5.3.190.0070.03015.64
5.3.180.0070.03315.64
5.3.170.0000.04015.64
5.3.160.0030.03715.64
5.3.150.0070.03315.64
5.3.140.0100.04015.64
5.3.130.0030.04015.64
5.3.120.0100.06315.64
5.3.110.0030.06715.64
5.3.100.0030.06015.64
5.3.90.0030.04315.64
5.3.80.0000.04315.64
5.3.70.0100.04715.64
5.3.60.0070.03715.64
5.3.50.0030.03715.64
5.3.40.0000.03715.64
5.3.30.0100.03015.64
5.3.20.0030.03315.64
5.3.10.0070.04015.64
5.3.00.0030.03315.64

preferences:
42.96 ms | 400 KiB | 5 Q