3v4l.org

run code in 300+ PHP versions simultaneously
<?php $spotify1="https://itunes.apple.com/search?term="; $spotify2=" - "; $spotify3="&limit=1"; $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 = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 13
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 64
Branch analysis from position: 45
2 jumps found. (Code = 77) Position 1 = 47, Position 2 = 63
Branch analysis from position: 47
2 jumps found. (Code = 78) Position 1 = 48, Position 2 = 63
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
Branch analysis from position: 64
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 13
Branch analysis from position: 23
Branch analysis from position: 13
filename:       /in/J17OF
function name:  (null)
number of ops:  139
compiled vars:  !0 = $spotify1, !1 = $spotify2, !2 = $spotify3, !3 = $fp, !4 = $STATS_FILE, !5 = $stats_file_contents, !6 = $radio_info, !7 = $temp, !8 = $search_for, !9 = $search_td, !10 = $matches, !11 = $match, !12 = $to_push, !13 = $x, !14 = $artist1, !15 = $song1, !16 = $ttt, !17 = $title, !18 = $img640_url, !19 = $img300_url, !20 = $img64_url, !21 = $spotify_url, !22 = $ch, !23 = $headers, !24 = $spotify, !25 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fitunes.apple.com%2Fsearch%3Fterm%3D'
    7     1        ASSIGN                                                   !1, '+-+'
    8     2        ASSIGN                                                   !2, '%26limit%3D1'
   12     3        INIT_FCALL                                               'fopen'
          4        SEND_VAR                                                 !4
          5        SEND_VAL                                                 'r'
          6        DO_ICALL                                         $29     
          7        ASSIGN                                                   !3, $29
   13     8        BOOL_NOT                                         ~31     !3
          9      > JMPZ                                                     ~31, ->11
         10    > > EXIT                                                     'Unable+to+connect+to+Icecast+server.'
   14    11    >   ASSIGN                                                   !5, ''
   15    12      > JMP                                                      ->18
         13    >   INIT_FCALL                                               'fread'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 1024
         16        DO_ICALL                                         $33     
         17        ASSIGN_OP                                     8          !5, $33
         18    >   INIT_FCALL                                               'feof'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $35     
         21        BOOL_NOT                                         ~36     $35
         22      > JMPNZ                                                    ~36, ->13
   17    23    >   INIT_FCALL                                               'fclose'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
   19    26        ASSIGN                                                   !6, <array>
   21    27        ASSIGN_DIM                                               !6, 'genre'
         28        OP_DATA                                                  ''
   22    29        ASSIGN_DIM                                               !6, 'listeners'
         30        OP_DATA                                                  ''
   23    31        ASSIGN_DIM                                               !6, 'now_playing'
         32        OP_DATA                                                  ''
   27    33        ASSIGN                                                   !7, <array>
   28    34        ASSIGN                                                   !8, '%3Ctd%5Cs%5B%5E%3E%5D%2Aclass%3D%22streamdata%22%3E%28.%2A%29%3C%5C%2Ftd%3E'
   29    35        ASSIGN                                                   !9, <array>
   30    36        INIT_FCALL                                               'preg_match_all'
         37        ROPE_INIT                                     3  ~46     '%2F'
         38        ROPE_ADD                                      1  ~46     ~46, !8
         39        ROPE_END                                      2  ~45     ~46, '%2FsiU'
         40        SEND_VAL                                                 ~45
         41        SEND_VAR                                                 !5
         42        SEND_REF                                                 !10
         43        DO_ICALL                                         $48     
         44      > JMPZ                                                     $48, ->64
   31    45    >   FETCH_DIM_R                                      ~49     !10, 0
         46      > FE_RESET_R                                       $50     ~49, ->63
         47    > > FE_FETCH_R                                               $50, !11, ->63
   32    48    >   INIT_FCALL                                               'str_replace'
         49        SEND_VAR                                                 !9
         50        SEND_VAL                                                 ''
         51        SEND_VAR                                                 !11
         52        DO_ICALL                                         $51     
         53        ASSIGN                                                   !12, $51
   33    54        INIT_FCALL                                               'trim'
         55        SEND_VAR                                                 !12
         56        DO_ICALL                                         $53     
         57        ASSIGN                                                   !12, $53
   34    58        INIT_FCALL                                               'array_push'
         59        SEND_REF                                                 !7
         60        SEND_VAR                                                 !12
         61        DO_ICALL                                                 
   31    62      > JMP                                                      ->47
         63    >   FE_FREE                                                  $50
   38    64    >   FETCH_DIM_R                                      ~57     !7, 4
         65        ASSIGN_DIM                                               !6, 'listeners'
         66        OP_DATA                                                  ~57
   39    67        FETCH_DIM_R                                      ~59     !7, 6
         68        ASSIGN_DIM                                               !6, 'genre'
         69        OP_DATA                                                  ~59
   42    70        FETCH_DIM_R                                      ~62     !7, 8
         71        FETCH_DIM_W                                      $60     !6, 'info'
         72        ASSIGN_DIM                                               $60, 'now_playing'
         73        OP_DATA                                                  ~62
   43    74        INIT_FCALL                                               'explode'
         75        SEND_VAL                                                 '+-+'
         76        FETCH_DIM_R                                      ~63     !7, 8
         77        SEND_VAL                                                 ~63
         78        DO_ICALL                                         $64     
         79        ASSIGN                                                   !13, $64
   44    80        FETCH_DIM_R                                      ~66     !13, 0
         81        ASSIGN                                                   !14, ~66
   45    82        FETCH_DIM_R                                      ~68     !13, 1
         83        ASSIGN                                                   !15, ~68
   46    84        INIT_FCALL                                               'str_replace'
         85        SEND_VAL                                                 '%26amp%3B'
         86        SEND_VAL                                                 'and'
         87        SEND_VAR                                                 !14
         88        DO_ICALL                                         $70     
         89        ASSIGN                                                   !14, $70
   47    90        INIT_FCALL                                               'str_replace'
         91        SEND_VAL                                                 '%26amp%3B'
         92        SEND_VAL                                                 'and'
         93        SEND_VAR                                                 !15
         94        DO_ICALL                                         $72     
         95        ASSIGN                                                   !15, $72
   48    96        ASSIGN                                                   !16, '+-+'
   49    97        CONCAT                                           ~75     !14, !16
         98        CONCAT                                           ~76     ~75, !15
         99        ASSIGN                                                   !17, ~76
   50   100        ASSIGN                                                   !18, 'https%3A%2F%2Fi.deep1.ru%2Fplayingnow%2Flogo_default.png'
   51   101        ASSIGN                                                   !19, 'https%3A%2F%2Fi.deep1.ru%2Fplayingnow%2Flogo_default.png'
   52   102        ASSIGN                                                   !20, 'https%3A%2F%2Fi.deep1.ru%2Fplayingnow%2Flogo_default.png'
   57   103        CONCAT                                           ~81     !0, !14
        104        CONCAT                                           ~82     ~81, !1
        105        CONCAT                                           ~83     ~82, !15
        106        CONCAT                                           ~84     ~83, !2
        107        ASSIGN                                           ~85     !21, ~84
        108        ECHO                                                     ~85
   59   109        INIT_FCALL                                               'str_replace'
        110        SEND_VAL                                                 '+'
        111        SEND_VAL                                                 '%2B'
        112        SEND_VAR                                                 !21
        113        DO_ICALL                                         $86     
        114        ASSIGN                                           ~87     !21, $86
        115        ECHO                                                     ~87
   64   116        INIT_FCALL_BY_NAME                                       'curl_init'
        117        SEND_VAR_EX                                              !21
        118        DO_FCALL                                      0  $88     
        119        ASSIGN                                                   !22, $88
   65   120        INIT_FCALL_BY_NAME                                       'curl_setopt'
        121        SEND_VAR_EX                                              !22
        122        FETCH_CONSTANT                                   ~90     'CURLOPT_HTTPHEADER'
        123        SEND_VAL_EX                                              ~90
        124        SEND_VAR_EX                                              !23
        125        DO_FCALL                                      0          
   66   126        INIT_FCALL_BY_NAME                                       'curl_exec'
        127        SEND_VAR_EX                                              !22
        128        DO_FCALL                                      0  $92     
        129        ASSIGN                                                   !24, $92
   68   130        INIT_FCALL_BY_NAME                                       'curl_close'
        131        SEND_VAR_EX                                              !22
        132        DO_FCALL                                      0          
   72   133        INIT_FCALL                                               'json_decode'
        134        SEND_VAR                                                 !24
        135        DO_ICALL                                         $95     
        136        ASSIGN                                                   !25, $95
   75   137        ECHO                                                     !18
        138      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.63 ms | 1408 KiB | 33 Q