3v4l.org

run code in 300+ PHP versions simultaneously
<?php $STATS_FILE = 'http://89.223.41.232:8000/status.xsl'; $DOCROOT = '/var/www/ideep1ru/playingnow/info'; // Корень сайта $hostname = "89.223.41.232"; $username = "radio"; // Имя пользователя для БД $password = "radio"; // И пароль $dbName = "radio"; // Имя БД $last1="http://ws.audioscrobbler.com/2.0/?method=track.getinfo&api_key=601f627a9fbb34ef24bc288cad4976e9&artist="; $last2="&track="; $spotify1="https://itunes.apple.com/search?term="; $spotify2=" - "; $spotify3="&limit=1"; $mysql_con = mysqli_connect($hostname,$username,$password,$dbName) OR die("Can't connect to database."); mysqli_select_db($mysql_con, $dbName) or die(mysql_error()); mysqli_query($mysql_con,"SET NAMES 'cp1251';"); mysqli_query($mysql_con,"SET CHARACTER SET 'cp1251';"); mysqli_query($mysql_con,"SET SESSION collation_connection = 'cp1251_general_ci';"); $fp = fopen($STATS_FILE,'r'); if(!$fp) { die("Unable to connect to Icecast server."); } $stats_file_contents = ''; while(!feof($fp)) { $stats_file_contents .= fread($fp,1024); } fclose($fp); $radio_info = array(); $radio_info['genre'] = ''; $radio_info['listeners'] = ''; $radio_info['now_playing'] = ''; $temp = array(); $search_for = "<td\s[^>]*class=\"streamdata\">(.*)<\/td>"; $search_td = array('<td class="streamdata">','</td>'); if(preg_match_all("/$search_for/siU",$stats_file_contents,$matches)) { foreach($matches[0] as $match) { $to_push = str_replace($search_td,'',$match); $to_push = trim($to_push); array_push($temp,$to_push); } } $radio_info['listeners'] = $temp[4]; $radio_info['genre'] = $temp[6]; //$radio_info['now_playing'] = $temp[8]; //$radio_info['now_playing'] = $temp[8]; $radio_info['info']['now_playing'] = $temp[8]; $x = explode(" - ",$temp[8]); $artist1 = $x[0]; $song1 = $x[1]; $artist1 = str_replace('&amp;', 'and', $artist1); $song1 = str_replace('&amp;', 'and', $song1); $ttt =" - "; $title = $artist1.$ttt.$song1; $img640_url= "https://i.deep1.ru/playingnow/logo_default.png"; $img300_url= "https://i.deep1.ru/playingnow/logo_default.png"; $img64_url= "https://i.deep1.ru/playingnow/logo_default.png"; echo $spotify_url=$spotify1.$artist1.$spotify2.$song1.$spotify3 ; echo $spotify_url = str_replace(' ', '+', $spotify_url); //$spotify_url = "https://itunes.apple.com/search?term=Kylie+Minogue"; $ch = curl_init($spotify_url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $spotify = curl_exec($ch); curl_close($ch); $obj = json_decode($spotify); //$total = $obj->resultCount->results; //$img640_url = $obj->resultCount[0]->results[1]->artworkUrl100; echo $img640_url;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 47) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 52
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 84, Position 2 = 103
Branch analysis from position: 84
2 jumps found. (Code = 77) Position 1 = 86, Position 2 = 102
Branch analysis from position: 86
2 jumps found. (Code = 78) Position 1 = 87, Position 2 = 102
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
Branch analysis from position: 102
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 102
Branch analysis from position: 103
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 52
Branch analysis from position: 62
Branch analysis from position: 52
filename:       /in/vgjoA
function name:  (null)
number of ops:  178
compiled vars:  !0 = $STATS_FILE, !1 = $DOCROOT, !2 = $hostname, !3 = $username, !4 = $password, !5 = $dbName, !6 = $last1, !7 = $last2, !8 = $spotify1, !9 = $spotify2, !10 = $spotify3, !11 = $mysql_con, !12 = $fp, !13 = $stats_file_contents, !14 = $radio_info, !15 = $temp, !16 = $search_for, !17 = $search_td, !18 = $matches, !19 = $match, !20 = $to_push, !21 = $x, !22 = $artist1, !23 = $song1, !24 = $ttt, !25 = $title, !26 = $img640_url, !27 = $img300_url, !28 = $img64_url, !29 = $spotify_url, !30 = $ch, !31 = $headers, !32 = $spotify, !33 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2F89.223.41.232%3A8000%2Fstatus.xsl'
    6     1        ASSIGN                                                   !1, '%2Fvar%2Fwww%2Fideep1ru%2Fplayingnow%2Finfo'
    7     2        ASSIGN                                                   !2, '89.223.41.232'
    8     3        ASSIGN                                                   !3, 'radio'
    9     4        ASSIGN                                                   !4, 'radio'
   10     5        ASSIGN                                                   !5, 'radio'
   11     6        ASSIGN                                                   !6, 'http%3A%2F%2Fws.audioscrobbler.com%2F2.0%2F%3Fmethod%3Dtrack.getinfo%26api_key%3D601f627a9fbb34ef24bc288cad4976e9%26artist%3D'
   12     7        ASSIGN                                                   !7, '%26track%3D'
   13     8        ASSIGN                                                   !8, 'https%3A%2F%2Fitunes.apple.com%2Fsearch%3Fterm%3D'
   14     9        ASSIGN                                                   !9, '+-+'
   15    10        ASSIGN                                                   !10, '%26limit%3D1'
   18    11        INIT_FCALL_BY_NAME                                       'mysqli_connect'
         12        SEND_VAR_EX                                              !2
         13        SEND_VAR_EX                                              !3
         14        SEND_VAR_EX                                              !4
         15        SEND_VAR_EX                                              !5
         16        DO_FCALL                                      0  $45     
         17        ASSIGN                                           ~46     !11, $45
         18      > JMPNZ_EX                                         ~46     ~46, ->21
         19    > > EXIT                                                     'Can%27t+connect+to+database.'
         20*       BOOL                                             ~46     <true>
   19    21    >   INIT_FCALL_BY_NAME                                       'mysqli_select_db'
         22        SEND_VAR_EX                                              !11
         23        SEND_VAR_EX                                              !5
         24        DO_FCALL                                      0  $47     
         25      > JMPNZ_EX                                         ~48     $47, ->30
         26    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         27        DO_FCALL                                      0  $49     
         28      > EXIT                                                     $49
         29*       BOOL                                             ~48     <true>
   20    30    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
         31        SEND_VAR_EX                                              !11
         32        SEND_VAL_EX                                              'SET+NAMES+%27cp1251%27%3B'
         33        DO_FCALL                                      0          
   21    34        INIT_FCALL_BY_NAME                                       'mysqli_query'
         35        SEND_VAR_EX                                              !11
         36        SEND_VAL_EX                                              'SET+CHARACTER+SET+%27cp1251%27%3B'
         37        DO_FCALL                                      0          
   22    38        INIT_FCALL_BY_NAME                                       'mysqli_query'
         39        SEND_VAR_EX                                              !11
         40        SEND_VAL_EX                                              'SET+SESSION+collation_connection+%3D+%27cp1251_general_ci%27%3B'
         41        DO_FCALL                                      0          
   25    42        INIT_FCALL                                               'fopen'
         43        SEND_VAR                                                 !0
         44        SEND_VAL                                                 'r'
         45        DO_ICALL                                         $53     
         46        ASSIGN                                                   !12, $53
   26    47        BOOL_NOT                                         ~55     !12
         48      > JMPZ                                                     ~55, ->50
         49    > > EXIT                                                     'Unable+to+connect+to+Icecast+server.'
   27    50    >   ASSIGN                                                   !13, ''
   28    51      > JMP                                                      ->57
         52    >   INIT_FCALL                                               'fread'
         53        SEND_VAR                                                 !12
         54        SEND_VAL                                                 1024
         55        DO_ICALL                                         $57     
         56        ASSIGN_OP                                     8          !13, $57
         57    >   INIT_FCALL                                               'feof'
         58        SEND_VAR                                                 !12
         59        DO_ICALL                                         $59     
         60        BOOL_NOT                                         ~60     $59
         61      > JMPNZ                                                    ~60, ->52
   30    62    >   INIT_FCALL                                               'fclose'
         63        SEND_VAR                                                 !12
         64        DO_ICALL                                                 
   32    65        ASSIGN                                                   !14, <array>
   34    66        ASSIGN_DIM                                               !14, 'genre'
         67        OP_DATA                                                  ''
   35    68        ASSIGN_DIM                                               !14, 'listeners'
         69        OP_DATA                                                  ''
   36    70        ASSIGN_DIM                                               !14, 'now_playing'
         71        OP_DATA                                                  ''
   40    72        ASSIGN                                                   !15, <array>
   41    73        ASSIGN                                                   !16, '%3Ctd%5Cs%5B%5E%3E%5D%2Aclass%3D%22streamdata%22%3E%28.%2A%29%3C%5C%2Ftd%3E'
   42    74        ASSIGN                                                   !17, <array>
   43    75        INIT_FCALL                                               'preg_match_all'
         76        ROPE_INIT                                     3  ~70     '%2F'
         77        ROPE_ADD                                      1  ~70     ~70, !16
         78        ROPE_END                                      2  ~69     ~70, '%2FsiU'
         79        SEND_VAL                                                 ~69
         80        SEND_VAR                                                 !13
         81        SEND_REF                                                 !18
         82        DO_ICALL                                         $72     
         83      > JMPZ                                                     $72, ->103
   44    84    >   FETCH_DIM_R                                      ~73     !18, 0
         85      > FE_RESET_R                                       $74     ~73, ->102
         86    > > FE_FETCH_R                                               $74, !19, ->102
   45    87    >   INIT_FCALL                                               'str_replace'
         88        SEND_VAR                                                 !17
         89        SEND_VAL                                                 ''
         90        SEND_VAR                                                 !19
         91        DO_ICALL                                         $75     
         92        ASSIGN                                                   !20, $75
   46    93        INIT_FCALL                                               'trim'
         94        SEND_VAR                                                 !20
         95        DO_ICALL                                         $77     
         96        ASSIGN                                                   !20, $77
   47    97        INIT_FCALL                                               'array_push'
         98        SEND_REF                                                 !15
         99        SEND_VAR                                                 !20
        100        DO_ICALL                                                 
   44   101      > JMP                                                      ->86
        102    >   FE_FREE                                                  $74
   51   103    >   FETCH_DIM_R                                      ~81     !15, 4
        104        ASSIGN_DIM                                               !14, 'listeners'
        105        OP_DATA                                                  ~81
   52   106        FETCH_DIM_R                                      ~83     !15, 6
        107        ASSIGN_DIM                                               !14, 'genre'
        108        OP_DATA                                                  ~83
   55   109        FETCH_DIM_R                                      ~86     !15, 8
        110        FETCH_DIM_W                                      $84     !14, 'info'
        111        ASSIGN_DIM                                               $84, 'now_playing'
        112        OP_DATA                                                  ~86
   56   113        INIT_FCALL                                               'explode'
        114        SEND_VAL                                                 '+-+'
        115        FETCH_DIM_R                                      ~87     !15, 8
        116        SEND_VAL                                                 ~87
        117        DO_ICALL                                         $88     
        118        ASSIGN                                                   !21, $88
   57   119        FETCH_DIM_R                                      ~90     !21, 0
        120        ASSIGN                                                   !22, ~90
   58   121        FETCH_DIM_R                                      ~92     !21, 1
        122        ASSIGN                                                   !23, ~92
   59   123        INIT_FCALL                                               'str_replace'
        124        SEND_VAL                                                 '%26amp%3B'
        125        SEND_VAL                                                 'and'
        126        SEND_VAR                                                 !22
        127        DO_ICALL                                         $94     
        128        ASSIGN                                                   !22, $94
   60   129        INIT_FCALL                                               'str_replace'
        130        SEND_VAL                                                 '%26amp%3B'
        131        SEND_VAL                                                 'and'
        132        SEND_VAR                                                 !23
        133        DO_ICALL                                         $96     
        134        ASSIGN                                                   !23, $96
   61   135        ASSIGN                                                   !24, '+-+'
   62   136        CONCAT                                           ~99     !22, !24
        137        CONCAT                                           ~100    ~99, !23
        138        ASSIGN                                                   !25, ~100
   63   139        ASSIGN                                                   !26, 'https%3A%2F%2Fi.deep1.ru%2Fplayingnow%2Flogo_default.png'
   64   140        ASSIGN                                                   !27, 'https%3A%2F%2Fi.deep1.ru%2Fplayingnow%2Flogo_default.png'
   65   141        ASSIGN                                                   !28, 'https%3A%2F%2Fi.deep1.ru%2Fplayingnow%2Flogo_default.png'
   70   142        CONCAT                                           ~105    !8, !22
        143        CONCAT                                           ~106    ~105, !9
        144        CONCAT                                           ~107    ~106, !23
        145        CONCAT                                           ~108    ~107, !10
        146        ASSIGN                                           ~109    !29, ~108
        147        ECHO                                                     ~109
   72   148        INIT_FCALL                                               'str_replace'
        149        SEND_VAL                                                 '+'
        150        SEND_VAL                                                 '%2B'
        151        SEND_VAR                                                 !29
        152        DO_ICALL                                         $110    
        153        ASSIGN                                           ~111    !29, $110
        154        ECHO                                                     ~111
   77   155        INIT_FCALL_BY_NAME                                       'curl_init'
        156        SEND_VAR_EX                                              !29
        157        DO_FCALL                                      0  $112    
        158        ASSIGN                                                   !30, $112
   78   159        INIT_FCALL_BY_NAME                                       'curl_setopt'
        160        SEND_VAR_EX                                              !30
        161        FETCH_CONSTANT                                   ~114    'CURLOPT_HTTPHEADER'
        162        SEND_VAL_EX                                              ~114
        163        SEND_VAR_EX                                              !31
        164        DO_FCALL                                      0          
   79   165        INIT_FCALL_BY_NAME                                       'curl_exec'
        166        SEND_VAR_EX                                              !30
        167        DO_FCALL                                      0  $116    
        168        ASSIGN                                                   !32, $116
   81   169        INIT_FCALL_BY_NAME                                       'curl_close'
        170        SEND_VAR_EX                                              !30
        171        DO_FCALL                                      0          
   85   172        INIT_FCALL                                               'json_decode'
        173        SEND_VAR                                                 !32
        174        DO_ICALL                                         $119    
        175        ASSIGN                                                   !33, $119
   88   176        ECHO                                                     !26
        177      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.52 ms | 1412 KiB | 33 Q