3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('GLPI_ROOT', '../../..'); include (GLPI_ROOT.'/inc/includes.php'); include_once('../inc/portswitch.class.php'); // 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(); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 59
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 53
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
2 jumps found. (Code = 44) Position 1 = 122, Position 2 = 61
Branch analysis from position: 122
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 61
4 jumps found. (Code = 188) Position 1 = 96, Position 2 = 98, Position 3 = 100, Position 4 = 91
Branch analysis from position: 96
1 jumps found. (Code = 42) Position 1 = 101
Branch analysis from position: 101
2 jumps found. (Code = 44) Position 1 = 122, Position 2 = 61
Branch analysis from position: 122
Branch analysis from position: 61
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 101
Branch analysis from position: 101
Branch analysis from position: 100
2 jumps found. (Code = 44) Position 1 = 122, Position 2 = 61
Branch analysis from position: 122
Branch analysis from position: 61
Branch analysis from position: 91
2 jumps found. (Code = 44) Position 1 = 93, Position 2 = 96
Branch analysis from position: 93
2 jumps found. (Code = 44) Position 1 = 95, Position 2 = 98
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
Branch analysis from position: 98
Branch analysis from position: 96
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
Branch analysis from position: 59
filename:       /in/ebvU4
function name:  (null)
number of ops:  123
compiled vars:  !0 = $changed, !1 = $i, !2 = $color
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'GLPI_ROOT'
          2        SEND_VAL                                                 '..%2F..%2F..'
          3        DO_ICALL                                                 
    3     4        FETCH_CONSTANT                                   ~4      'GLPI_ROOT'
          5        CONCAT                                           ~5      ~4, '%2Finc%2Fincludes.php'
          6        INCLUDE_OR_EVAL                                          ~5, INCLUDE
    4     7        INCLUDE_OR_EVAL                                          '..%2Finc%2Fportswitch.class.php', INCLUDE_ONCE
    7     8        FETCH_IS                                         ~8      '_SESSION'
          9        ISSET_ISEMPTY_DIM_OBJ                         0          ~8, 'port_changed'
         10      > JMPZ                                                     ~9, ->59
    8    11    >   FETCH_R                      global              ~10     '_SESSION'
         12        FETCH_DIM_R                                      ~11     ~10, 'port_changed'
         13        ASSIGN                                                   !0, ~11
    9    14        FETCH_UNSET                                      $13     '_SESSION'
         15        UNSET_DIM                                                $13, 'port_changed'
   11    16        FETCH_STATIC_PROP_R          unknown             ~14     'config_data'
         17        FETCH_DIM_R                                      ~15     ~14, !0
         18        FETCH_DIM_R                                      ~16     ~15, 'link'
         19        IS_NOT_EQUAL                                             ~16, '0.0.0.0'
         20      > JMPZ                                                     ~17, ->53
   12    21    >   INIT_FCALL                                               'exec'
         22        FETCH_STATIC_PROP_R          unknown             ~21     'config_data'
         23        FETCH_DIM_R                                      ~22     ~21, !0
         24        FETCH_DIM_R                                      ~23     ~22, 'ip'
         25        CONCAT                                           ~24     '..%2Fscripts%2Fcheckport.sh+', ~23
         26        CONCAT                                           ~25     ~24, '+'
         27        FETCH_STATIC_PROP_R          unknown             ~26     'config_data'
         28        FETCH_DIM_R                                      ~27     ~26, !0
         29        FETCH_DIM_R                                      ~28     ~27, 'port'
         30        CONCAT                                           ~29     ~25, ~28
         31        CONCAT                                           ~30     ~29, '+'
         32        FETCH_STATIC_PROP_R          unknown             ~31     'config_data'
         33        FETCH_DIM_R                                      ~32     ~31, !0
         34        FETCH_DIM_R                                      ~33     ~32, 'passwort'
         35        CONCAT                                           ~34     ~30, ~33
         36        CONCAT                                           ~35     ~34, '+'
         37        FETCH_STATIC_PROP_R          unknown             ~36     'config_data'
         38        FETCH_DIM_R                                      ~37     ~36, !0
         39        FETCH_DIM_R                                      ~38     ~37, 'stack'
         40        CONCAT                                           ~39     ~35, ~38
         41        CONCAT                                           ~40     ~39, '+'
         42        FETCH_STATIC_PROP_R          unknown             ~41     'config_data'
         43        FETCH_DIM_R                                      ~42     ~41, !0
         44        FETCH_DIM_R                                      ~43     ~42, 'hostname'
         45        CONCAT                                           ~44     ~40, ~43
         46        SEND_VAL                                                 ~44
         47        DO_ICALL                                         $45     
         48        FETCH_STATIC_PROP_W          unknown             $18     'config_data'
         49        FETCH_DIM_W                                      $19     $18, !0
         50        ASSIGN_DIM                                               $19, 'link'
         51        OP_DATA                                                  $45
         52      > JMP                                                      ->57
   14    53    >   FETCH_STATIC_PROP_W          unknown             $46     'config_data'
         54        FETCH_DIM_W                                      $47     $46, !0
         55        ASSIGN_DIM                                               $47, 'link'
         56        OP_DATA                                                  'Konnte+nicht+abgefragt+werden.+%28Konfiguration+pr%C3%BCfen%21%29'
   17    57    >   INIT_STATIC_METHOD_CALL                                  'PluginPortswitchPortswitch', 'saveConfig'
         58        DO_FCALL                                      0          
   21    59    >   ASSIGN                                                   !1, 0
         60      > JMP                                                      ->118
   24    61    >   ECHO                                                     '%09%3Ch1%3E'
         62        FETCH_STATIC_PROP_R          unknown             ~51     'config_data'
         63        FETCH_DIM_R                                      ~52     ~51, !1
         64        FETCH_DIM_R                                      ~53     ~52, 'name'
         65        ECHO                                                     ~53
         66        ECHO                                                     '+auf+Switch+'
         67        FETCH_STATIC_PROP_R          unknown             ~54     'config_data'
         68        FETCH_DIM_R                                      ~55     ~54, !1
         69        FETCH_DIM_R                                      ~56     ~55, 'hostname'
         70        ECHO                                                     ~56
         71        ECHO                                                     '%3A'
         72        FETCH_STATIC_PROP_R          unknown             ~57     'config_data'
         73        FETCH_DIM_R                                      ~58     ~57, !1
         74        FETCH_DIM_R                                      ~59     ~58, 'port'
         75        ECHO                                                     ~59
         76        ECHO                                                     '+Kontrolle%3C%2Fh1%3E+%0A%09%3Cform+method%3D%22POST%22+action%3D%22'
   25    77        FETCH_CONSTANT                                   ~60     'GLPI_ROOT'
         78        ECHO                                                     ~60
         79        ECHO                                                     '%2Fplugins%2Fportswitch%2Ffront%2Fportswitch.form.php%22%3E%0A%09%09%3Cp%3E%0A%09%09%09Ticketnummern+%28mit+Komma+trennen%2C+z.B.+%3Ci%3E%221024%2C2048%2C...%22%3C%2Fi%3E%3A+%3Cinput+type%3D%22text%22+name%3D%22kommentar%22+value%3D%22'
   27    80        FETCH_STATIC_PROP_R          unknown             ~61     'config_data'
         81        FETCH_DIM_R                                      ~62     ~61, !1
         82        FETCH_DIM_R                                      ~63     ~62, 'kommentar'
         83        ECHO                                                     ~63
         84        ECHO                                                     '%22%3E%3Cbr%3E%0A%09%09%09%3Cinput+type%3D%22submit%22+name%3D%22Aktualisieren%22+value%3D%22Aktualisieren%22%3E%0A%09%09%3C%2Fp%3E%0A%09%09%3Cp%3E%0A%09%09%09%3Cinput+type%3D%22hidden%22+name%3D%22sent%22+value%3D%22'
   31    85        ECHO                                                     !1
         86        ECHO                                                     '%22%3E%0A%09%09%09%3Cinput+type%3D%22submit%22+name%3D%22deactivate%22+value%3D%22Deaktivieren%22%3E%0A%09%09%09%3Cinput+type%3D%22submit%22+name%3D%22activate%22+value%3D%22Aktivieren%22%3E%0A%09%09%3C%2Fp%3E%0A%09%09%3Cp%3E%26nbsp%3B%3C%2Fp%3E%0A%09%09%3Cp%3E%0A%09%09%09'
   38    87        FETCH_STATIC_PROP_R          unknown             ~64     'config_data'
         88        FETCH_DIM_R                                      ~65     ~64, !1
         89        FETCH_DIM_R                                      ~66     ~65, 'link'
         90      > SWITCH_STRING                                            ~66, [ 'Down':->96, 'Up':->98, ], ->100
   39    91    >   CASE                                                     ~66, 'Down'
         92      > JMPNZ                                                    ~67, ->96
   42    93    >   CASE                                                     ~66, 'Up'
         94      > JMPNZ                                                    ~67, ->98
         95    > > JMP                                                      ->100
   40    96    >   ASSIGN                                                   !2, '%23FF0000'
   41    97      > JMP                                                      ->101
   43    98    >   ASSIGN                                                   !2, '%2300FF00'
   44    99      > JMP                                                      ->101
   46   100    >   ASSIGN                                                   !2, '%230000FF'
        101    >   FREE                                                     ~66
   49   102        ECHO                                                     '%09%09%09Port+Link-Status%3A+%3Cspan+style%3D%22color%3A'
        103        ECHO                                                     !2
        104        ECHO                                                     '%22%3E'
        105        FETCH_STATIC_PROP_R          unknown             ~71     'config_data'
        106        FETCH_DIM_R                                      ~72     ~71, !1
        107        FETCH_DIM_R                                      ~73     ~72, 'link'
        108        ECHO                                                     ~73
        109        ECHO                                                     '%3C%2Fspan%3E%3Cbr%3E%0A%09%09%09Port+Status%3A+'
   50   110        INIT_STATIC_METHOD_CALL                                  'PluginPortswitchPortswitch', 'getHtmlStatus'
        111        SEND_VAR_EX                                              !1
        112        DO_FCALL                                      0  $74     
        113        ECHO                                                     $74
        114        ECHO                                                     '%3Cbr%3E%3Cbr%3E%0A%09%09%09%3Cinput+type%3D%22submit%22+name%3D%22link%22+value%3D%22Update+Link+Status%22%3E%0A%09%09%3C%2Fp%3E%0A'
   54   115        INIT_STATIC_METHOD_CALL                                  'Html', 'closeForm'
        116        DO_FCALL                                      0          
   21   117        PRE_INC                                                  !1
        118    >   FETCH_STATIC_PROP_R          unknown             ~77     'config_data'
        119        COUNT                                            ~78     ~77
        120        IS_SMALLER                                               !1, ~78
        121      > JMPNZ                                                    ~79, ->61
   56   122    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.3 ms | 1408 KiB | 17 Q