3v4l.org

run code in 300+ PHP versions simultaneously
<center> <?php /* Live SHOUTcast statistics for multiple servers This script is (C) Bell Online Ltd 2012 If you use this script, please leave the copyright notice and link at the bottom of the page or link to mixstream.net somewhere on your website. Feel free to modify it in any other way to suit your needs. Version: v1.1 ## Updates: ## 1.1, Added fclose() */ /* ---------- General configuration ---------- */ $station_name = "Galaxy Radio"; $refresh = "30"; // Page refresh time in seconds. Put 0 for no refresh $timeout = "1"; // Number of seconds before connecton times out - a higher value will slow the page down if any servers are offline /* ----------- Server configuration ---------- */ // Note: dont include http:// // Main server: The song title will be taken from this server $ip[1] = "107.150.2.89"; $port[1] = "8000"; /* ----- No need to edit below this line ----- */ /* ------------------------------------------- */ $servers = count($ip); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <?php if ($refresh != "0") { print "<meta http-equiv=\"refresh\" content=\"$refresh\">\n"; } print "<title>$station_name SHOUTcast Stats</title>\n"; ?> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; margin: 5px; background-color: #fff; } div { background-color: #fef9f2; border: 1px solid #000; padding: 4px; margin-bottom: 5px; width: 450px; } div div { margin: 5px; border: 0; background-color: #fef9f2; margin: 5px; margin-bottom: 0; } h1 { font-size: 22px; color: #000; margin: 2px; } h2 { font-size: 14px; color: #336666; margin: 2px; } p { margin: 5px; } a { color: #666699; text-decoration: none; } a:hover { color: #993333; } div.line { border-bottom: 1px dashed #000; height: 3px; font-size: 1px; margin-top: 0; } div#blu, div#blu div { background-color: #b2bfc0; } .red { color: #CC0000; font-weight: bold; } .small { font-size: 10px; } --> </style> </head> <body> <?php $i = "1"; while($i<=$servers) { $fp = @fsockopen($ip[$i],$port[$i],$errno,$errstr,$timeout); if (!$fp) { $listeners[$i] = "0"; $msg[$i] = "<span class=\"red\">ERROR [Ο server είναι εκτός λειτουργίας]</span>"; $error[$i] = "1"; } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $info = str_replace('<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>', "", $info); $info = str_replace('</body></html>', "", $info); $stats = explode(',', $info); if (empty($stats[1]) ) { $listeners[$i] = "0"; $msg[$i] = "<span class=\"red\">ERROR [Δεν εκπέμπει κάποιος DJ]</span>"; $error[$i] = "1"; } else { if ($stats[1] == "1") { $song[$i] = $stats[6]; $listeners[$i] = $stats[0]; $max[$i] = $stats[3]; $bitrate[$i] = $stats[5]; $peak[$i] = $stats[2]; if ($stats[0] == $max[$i]) { $msg[$i] .= "<span class=\"red\">"; } $msg[$i] .= "Online στα $bitrate[$i] kbps με $listeners[$i] συνδεδεμένους ακροατές"; if ($stats[0] == $max[$i]) { $msg[$i] .= "</span>"; } //$msg[$i] .= "\n <p><b>Listener peak:</b> $peak[$i]"; } else { $listeners[$i] = "0"; $msg[$i] = " <span class=\"red\">ERROR [Cannot get info from server]</span>"; $error[$i] = "1"; } } } //fclose($fp); $i++; } $total_listeners = array_sum($listeners) ; print "<div>\n <div>\n <p><b>Το τραγούδι που ακούμε:</b> $song[1]</p>\n </div>\n</div>\n<div>\n"; $i = "1"; while($i<=$servers) { print " <div>\n"; if ($max[$i] > 0) { $percentage = round(($listeners[$i] / $max[$i] * 100)); $timesby = (300 / $max[$i]); $barlength = round(($listeners[$i] * "$timesby")); } if ($error[$i] != "1") { ?> <?php } else { ?> <?php } print "<b>Radio:</b> $msg[$i]"; $i++; } $time_difference = "0"; // BST: 1 GMT: 0 $time_difference = ($time_difference * 60 * 60); $time = date("h:ia", time() + $time_difference); $date = date("jS F, Y", time() + 0); ?> <div> </div> </body> </html> </center>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 132
Branch analysis from position: 132
2 jumps found. (Code = 44) Position 1 = 134, Position 2 = 24
Branch analysis from position: 134
1 jumps found. (Code = 42) Position 1 = 178
Branch analysis from position: 178
2 jumps found. (Code = 44) Position 1 = 180, Position 2 = 145
Branch analysis from position: 180
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 145
2 jumps found. (Code = 43) Position 1 = 149, Position 2 = 167
Branch analysis from position: 149
2 jumps found. (Code = 43) Position 1 = 170, Position 2 = 172
Branch analysis from position: 170
1 jumps found. (Code = 42) Position 1 = 173
Branch analysis from position: 173
2 jumps found. (Code = 44) Position 1 = 180, Position 2 = 145
Branch analysis from position: 180
Branch analysis from position: 145
Branch analysis from position: 172
2 jumps found. (Code = 44) Position 1 = 180, Position 2 = 145
Branch analysis from position: 180
Branch analysis from position: 145
Branch analysis from position: 167
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 45
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 131
Branch analysis from position: 131
2 jumps found. (Code = 44) Position 1 = 134, Position 2 = 24
Branch analysis from position: 134
Branch analysis from position: 24
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 50
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 85
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 131
Branch analysis from position: 131
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 125
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 109
Branch analysis from position: 107
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 124
Branch analysis from position: 122
1 jumps found. (Code = 42) Position 1 = 131
Branch analysis from position: 131
Branch analysis from position: 124
Branch analysis from position: 109
Branch analysis from position: 125
2 jumps found. (Code = 44) Position 1 = 134, Position 2 = 24
Branch analysis from position: 134
Branch analysis from position: 24
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 50
Branch analysis from position: 59
Branch analysis from position: 50
Branch analysis from position: 17
filename:       /in/ehVCg
function name:  (null)
number of ops:  202
compiled vars:  !0 = $station_name, !1 = $refresh, !2 = $timeout, !3 = $ip, !4 = $port, !5 = $servers, !6 = $i, !7 = $fp, !8 = $errno, !9 = $errstr, !10 = $listeners, !11 = $msg, !12 = $error, !13 = $info, !14 = $stats, !15 = $song, !16 = $max, !17 = $bitrate, !18 = $peak, !19 = $total_listeners, !20 = $percentage, !21 = $timesby, !22 = $barlength, !23 = $time_difference, !24 = $time, !25 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Ccenter%3E%0A'
   22     1        ASSIGN                                                   !0, 'Galaxy+Radio'
   24     2        ASSIGN                                                   !1, '30'
   25     3        ASSIGN                                                   !2, '1'
   32     4        ASSIGN_DIM                                               !3, 1
          5        OP_DATA                                                  '107.150.2.89'
   33     6        ASSIGN_DIM                                               !4, 1
          7        OP_DATA                                                  '8000'
   37     8        COUNT                                            ~31     !3
          9        ASSIGN                                                   !5, ~31
   39    10        ECHO                                                     '%3C%21DOCTYPE+HTML+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+HTML+4.01+Transitional%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fhtml4%2Floose.dtd%22%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3DUTF-8%22%3E%0A'
   44    11        IS_NOT_EQUAL                                             !1, '0'
         12      > JMPZ                                                     ~33, ->17
   46    13    >   ROPE_INIT                                     3  ~35     '%3Cmeta+http-equiv%3D%22refresh%22+content%3D%22'
         14        ROPE_ADD                                      1  ~35     ~35, !1
         15        ROPE_END                                      2  ~34     ~35, '%22%3E%0A'
         16        ECHO                                                     ~34
   48    17    >   ROPE_INIT                                     3  ~38     '%3Ctitle%3E'
         18        ROPE_ADD                                      1  ~38     ~38, !0
         19        ROPE_END                                      2  ~37     ~38, '+SHOUTcast+Stats%3C%2Ftitle%3E%0A'
         20        ECHO                                                     ~37
   50    21        ECHO                                                     '%3Cstyle+type%3D%22text%2Fcss%22%3E%0A%3C%21--%0Abody+%7B%0A%09font-family%3A+Arial%2C+Helvetica%2C+sans-serif%3B%0A%09font-size%3A+12px%3B%0A%09color%3A+%23333333%3B%0A%09margin%3A+5px%3B%0A%09background-color%3A+%23fff%3B%0A%7D%0Adiv+%7B%0A%09background-color%3A+%23fef9f2%3B%0A%09border%3A+1px+solid+%23000%3B%0A%09padding%3A+4px%3B%0A%09margin-bottom%3A+5px%3B%0A%09width%3A+450px%3B%0A%7D%0Adiv+div+%7B%0A%09margin%3A+5px%3B%0A%09border%3A+0%3B%0A%09background-color%3A+%23fef9f2%3B%0A%09margin%3A+5px%3B%0A%09margin-bottom%3A+0%3B%0A%7D%0Ah1+%7B%0A%09font-size%3A+22px%3B%0A%09color%3A+%23000%3B%0A%09margin%3A+2px%3B%0A%7D%0Ah2+%7B%0A%09font-size%3A+14px%3B%0A%09color%3A+%23336666%3B%0A%09margin%3A+2px%3B%0A%7D%0Ap+%7B%0A%09margin%3A+5px%3B%0A%7D%0Aa+%7B%0A%09color%3A+%23666699%3B%0A%09text-decoration%3A+none%3B%0A%7D%0Aa%3Ahover+%7B%0A%09color%3A+%23993333%3B%0A%7D%0Adiv.line+%7B%0A%09border-bottom%3A+1px+dashed+%23000%3B%0A%09height%3A+3px%3B%0A%09font-size%3A+1px%3B%0A%09margin-top%3A+0%3B%0A%7D%0Adiv%23blu%2C+div%23blu+div+%7B%0A%09background-color%3A+%23b2bfc0%3B%0A%7D%0A.red+%7B%0A%09color%3A+%23CC0000%3B%0A%09font-weight%3A+bold%3B%0A%7D%0A.small+%7B%0A%09font-size%3A+10px%3B%0A%7D%0A--%3E%0A%3C%2Fstyle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A'
  114    22        ASSIGN                                                   !6, '1'
  115    23      > JMP                                                      ->132
  117    24    >   BEGIN_SILENCE                                    ~41     
         25        INIT_FCALL                                               'fsockopen'
         26        FETCH_DIM_R                                      ~42     !3, !6
         27        SEND_VAL                                                 ~42
         28        FETCH_DIM_R                                      ~43     !4, !6
         29        SEND_VAL                                                 ~43
         30        SEND_REF                                                 !8
         31        SEND_REF                                                 !9
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $44     
         34        END_SILENCE                                              ~41
         35        ASSIGN                                                   !7, $44
  118    36        BOOL_NOT                                         ~46     !7
         37      > JMPZ                                                     ~46, ->45
  120    38    >   ASSIGN_DIM                                               !10, !6
         39        OP_DATA                                                  '0'
  121    40        ASSIGN_DIM                                               !11, !6
         41        OP_DATA                                                  '%3Cspan+class%3D%22red%22%3EERROR+%5B%CE%9F+server+%CE%B5%CE%AF%CE%BD%CE%B1%CE%B9+%CE%B5%CE%BA%CF%84%CF%8C%CF%82+%CE%BB%CE%B5%CE%B9%CF%84%CE%BF%CF%85%CF%81%CE%B3%CE%AF%CE%B1%CF%82%5D%3C%2Fspan%3E'
  122    42        ASSIGN_DIM                                               !12, !6
         43        OP_DATA                                                  '1'
         44      > JMP                                                      ->131
  126    45    >   INIT_FCALL                                               'fputs'
         46        SEND_VAR                                                 !7
         47        SEND_VAL                                                 'GET+%2F7.html+HTTP%2F1.0%0D%0AUser-Agent%3A+Mozilla%0D%0A%0D%0A'
         48        DO_ICALL                                                 
  127    49      > JMP                                                      ->54
  129    50    >   INIT_FCALL                                               'fgets'
         51        SEND_VAR                                                 !7
         52        DO_ICALL                                         $51     
         53        ASSIGN                                                   !13, $51
  127    54    >   INIT_FCALL                                               'feof'
         55        SEND_VAR                                                 !7
         56        DO_ICALL                                         $53     
         57        BOOL_NOT                                         ~54     $53
         58      > JMPNZ                                                    ~54, ->50
  131    59    >   INIT_FCALL                                               'str_replace'
         60        SEND_VAL                                                 '%3CHTML%3E%3Cmeta+http-equiv%3D%22Pragma%22+content%3D%22no-cache%22%3E%3C%2Fhead%3E%3Cbody%3E'
         61        SEND_VAL                                                 ''
         62        SEND_VAR                                                 !13
         63        DO_ICALL                                         $55     
         64        ASSIGN                                                   !13, $55
  132    65        INIT_FCALL                                               'str_replace'
         66        SEND_VAL                                                 '%3C%2Fbody%3E%3C%2Fhtml%3E'
         67        SEND_VAL                                                 ''
         68        SEND_VAR                                                 !13
         69        DO_ICALL                                         $57     
         70        ASSIGN                                                   !13, $57
  133    71        INIT_FCALL                                               'explode'
         72        SEND_VAL                                                 '%2C'
         73        SEND_VAR                                                 !13
         74        DO_ICALL                                         $59     
         75        ASSIGN                                                   !14, $59
  134    76        ISSET_ISEMPTY_DIM_OBJ                         1          !14, 1
         77      > JMPZ                                                     ~61, ->85
  136    78    >   ASSIGN_DIM                                               !10, !6
         79        OP_DATA                                                  '0'
  137    80        ASSIGN_DIM                                               !11, !6
         81        OP_DATA                                                  '%3Cspan+class%3D%22red%22%3EERROR+%5B%CE%94%CE%B5%CE%BD+%CE%B5%CE%BA%CF%80%CE%AD%CE%BC%CF%80%CE%B5%CE%B9+%CE%BA%CE%AC%CF%80%CE%BF%CE%B9%CE%BF%CF%82+DJ%5D%3C%2Fspan%3E'
  138    82        ASSIGN_DIM                                               !12, !6
         83        OP_DATA                                                  '1'
         84      > JMP                                                      ->131
  142    85    >   FETCH_DIM_R                                      ~65     !14, 1
         86        IS_EQUAL                                                 ~65, '1'
         87      > JMPZ                                                     ~66, ->125
  144    88    >   FETCH_DIM_R                                      ~68     !14, 6
         89        ASSIGN_DIM                                               !15, !6
         90        OP_DATA                                                  ~68
  145    91        FETCH_DIM_R                                      ~70     !14, 0
         92        ASSIGN_DIM                                               !10, !6
         93        OP_DATA                                                  ~70
  146    94        FETCH_DIM_R                                      ~72     !14, 3
         95        ASSIGN_DIM                                               !16, !6
         96        OP_DATA                                                  ~72
  147    97        FETCH_DIM_R                                      ~74     !14, 5
         98        ASSIGN_DIM                                               !17, !6
         99        OP_DATA                                                  ~74
  148   100        FETCH_DIM_R                                      ~76     !14, 2
        101        ASSIGN_DIM                                               !18, !6
        102        OP_DATA                                                  ~76
  149   103        FETCH_DIM_R                                      ~77     !14, 0
        104        FETCH_DIM_R                                      ~78     !16, !6
        105        IS_EQUAL                                                 ~77, ~78
        106      > JMPZ                                                     ~79, ->109
  151   107    >   ASSIGN_DIM_OP                .=               8          !11, !6
        108        OP_DATA                                                  '%3Cspan+class%3D%22red%22%3E'
  153   109    >   ROPE_INIT                                     5  ~85     'Online+%CF%83%CF%84%CE%B1+'
        110        FETCH_DIM_R                                      ~82     !17, !6
        111        ROPE_ADD                                      1  ~85     ~85, ~82
        112        ROPE_ADD                                      2  ~85     ~85, '+kbps+%CE%BC%CE%B5+'
        113        FETCH_DIM_R                                      ~83     !10, !6
        114        ROPE_ADD                                      3  ~85     ~85, ~83
        115        ROPE_END                                      4  ~84     ~85, '+%CF%83%CF%85%CE%BD%CE%B4%CE%B5%CE%B4%CE%B5%CE%BC%CE%AD%CE%BD%CE%BF%CF%85%CF%82+%CE%B1%CE%BA%CF%81%CE%BF%CE%B1%CF%84%CE%AD%CF%82'
        116        ASSIGN_DIM_OP                .=               8          !11, !6
        117        OP_DATA                                                  ~84
  154   118        FETCH_DIM_R                                      ~88     !14, 0
        119        FETCH_DIM_R                                      ~89     !16, !6
        120        IS_EQUAL                                                 ~88, ~89
        121      > JMPZ                                                     ~90, ->124
  156   122    >   ASSIGN_DIM_OP                .=               8          !11, !6
        123        OP_DATA                                                  '%3C%2Fspan%3E'
        124    > > JMP                                                      ->131
  162   125    >   ASSIGN_DIM                                               !10, !6
        126        OP_DATA                                                  '0'
  163   127        ASSIGN_DIM                                               !11, !6
        128        OP_DATA                                                  '++++%3Cspan+class%3D%22red%22%3EERROR+%5BCannot+get+info+from+server%5D%3C%2Fspan%3E'
  164   129        ASSIGN_DIM                                               !12, !6
        130        OP_DATA                                                  '1'
  169   131    >   PRE_INC                                                  !6
  115   132    >   IS_SMALLER_OR_EQUAL                                      !6, !5
        133      > JMPNZ                                                    ~96, ->24
  171   134    >   INIT_FCALL                                               'array_sum'
        135        SEND_VAR                                                 !10
        136        DO_ICALL                                         $97     
        137        ASSIGN                                                   !19, $97
  172   138        ROPE_INIT                                     3  ~101    '%3Cdiv%3E%0A++%3Cdiv%3E%0A++++%3Cp%3E%3Cb%3E%CE%A4%CE%BF+%CF%84%CF%81%CE%B1%CE%B3%CE%BF%CF%8D%CE%B4%CE%B9+%CF%80%CE%BF%CF%85+%CE%B1%CE%BA%CE%BF%CF%8D%CE%BC%CE%B5%3A%3C%2Fb%3E+'
        139        FETCH_DIM_R                                      ~99     !15, 1
        140        ROPE_ADD                                      1  ~101    ~101, ~99
        141        ROPE_END                                      2  ~100    ~101, '%3C%2Fp%3E%0A++%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv%3E%0A'
        142        ECHO                                                     ~100
  173   143        ASSIGN                                                   !6, '1'
  174   144      > JMP                                                      ->178
  176   145    >   ECHO                                                     '++%3Cdiv%3E%0A'
  177   146        FETCH_DIM_R                                      ~104    !16, !6
        147        IS_SMALLER                                               0, ~104
        148      > JMPZ                                                     ~105, ->167
  179   149    >   INIT_FCALL                                               'round'
        150        FETCH_DIM_R                                      ~106    !10, !6
        151        FETCH_DIM_R                                      ~107    !16, !6
        152        DIV                                              ~108    ~106, ~107
        153        MUL                                              ~109    ~108, 100
        154        SEND_VAL                                                 ~109
        155        DO_ICALL                                         $110    
        156        ASSIGN                                                   !20, $110
  180   157        FETCH_DIM_R                                      ~112    !16, !6
        158        DIV                                              ~113    300, ~112
        159        ASSIGN                                                   !21, ~113
  181   160        INIT_FCALL                                               'round'
        161        FETCH_DIM_R                                      ~115    !10, !6
        162        CAST                                          6  ~116    !21
        163        MUL                                              ~117    ~115, ~116
        164        SEND_VAL                                                 ~117
        165        DO_ICALL                                         $118    
        166        ASSIGN                                                   !22, $118
  183   167    >   FETCH_DIM_R                                      ~120    !12, !6
        168        IS_NOT_EQUAL                                             ~120, '1'
        169      > JMPZ                                                     ~121, ->172
  186   170    >   ECHO                                                     '%0A'
        171      > JMP                                                      ->173
  192   172    >   ECHO                                                     '%0A'
  195   173    >   NOP                                                      
        174        FETCH_DIM_R                                      ~122    !11, !6
        175        FAST_CONCAT                                      ~123    '%3Cb%3ERadio%3A%3C%2Fb%3E+', ~122
        176        ECHO                                                     ~123
  196   177        PRE_INC                                                  !6
  174   178    >   IS_SMALLER_OR_EQUAL                                      !6, !5
        179      > JMPNZ                                                    ~125, ->145
  199   180    >   ASSIGN                                                   !23, '0'
  200   181        MUL                                              ~127    !23, 60
        182        MUL                                              ~128    ~127, 60
        183        ASSIGN                                                   !23, ~128
  201   184        INIT_FCALL                                               'date'
        185        SEND_VAL                                                 'h%3Aia'
        186        INIT_FCALL                                               'time'
        187        DO_ICALL                                         $130    
        188        ADD                                              ~131    $130, !23
        189        SEND_VAL                                                 ~131
        190        DO_ICALL                                         $132    
        191        ASSIGN                                                   !24, $132
  202   192        INIT_FCALL                                               'date'
        193        SEND_VAL                                                 'jS+F%2C+Y'
        194        INIT_FCALL                                               'time'
        195        DO_ICALL                                         $134    
        196        ADD                                              ~135    $134, 0
        197        SEND_VAL                                                 ~135
        198        DO_ICALL                                         $136    
        199        ASSIGN                                                   !25, $136
  204   200        ECHO                                                     '%3Cdiv%3E%0A%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A%3C%2Fcenter%3E'
  208   201      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.24 ms | 1408 KiB | 33 Q