3v4l.org

run code in 300+ PHP versions simultaneously
<?php $client_id = "6813c5d125013568ef986b73e4ba265c"; require_once 'functions.php'; //$client = new Services_Soundcloud('6813c5d125013568ef986b73e4ba265c', '2eb6f212de6f4963c3873f8afdf517e9'); // a permalink to a track $track_url = 'http://soundcloud.com/forss/voca-nomen-tuum'; if($_GET['url']){ $track_url = $_GET['url']; } $url="http://api.soundcloud.com/resolve.json?url=$track_url&client_id=$client_id"; $headers1=get_headers($url,1); $location1=$headers['Location']; $location1 = modify_url(array('client_id' => '6813c5d125013568ef986b73e4ba265c'), $location1); $location1=str_replace("//tracks","/tracks",$location1); $json = file_get_contents($location1); $obj = json_decode($json, true); $stream=$obj['stream_url']."?client_id=$client_id"; $track_id=$obj['id']; $headers2=get_headers($stream,1); $location2=$headers2['Location']; if(!$_GET['d']){ echo $track_id; echo $obj; } else { $m2=file_get_contents($location2); $rand=rand(1,100000); $filename="files/".$track_id."-".$rand.".mp3"; file_put_contents($filename,$m2); echo "<a href=$filename>download</a>"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 62
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/8spC1
function name:  (null)
number of ops:  85
compiled vars:  !0 = $client_id, !1 = $track_url, !2 = $url, !3 = $headers1, !4 = $location1, !5 = $headers, !6 = $json, !7 = $obj, !8 = $stream, !9 = $track_id, !10 = $headers2, !11 = $location2, !12 = $m2, !13 = $rand, !14 = $filename
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '6813c5d125013568ef986b73e4ba265c'
    3     1        INCLUDE_OR_EVAL                                          'functions.php', REQUIRE_ONCE
    7     2        ASSIGN                                                   !1, 'http%3A%2F%2Fsoundcloud.com%2Fforss%2Fvoca-nomen-tuum'
    9     3        FETCH_R                      global              ~18     '_GET'
          4        FETCH_DIM_R                                      ~19     ~18, 'url'
          5      > JMPZ                                                     ~19, ->9
   10     6    >   FETCH_R                      global              ~20     '_GET'
          7        FETCH_DIM_R                                      ~21     ~20, 'url'
          8        ASSIGN                                                   !1, ~21
   13     9    >   ROPE_INIT                                     4  ~24     'http%3A%2F%2Fapi.soundcloud.com%2Fresolve.json%3Furl%3D'
         10        ROPE_ADD                                      1  ~24     ~24, !1
         11        ROPE_ADD                                      2  ~24     ~24, '%26client_id%3D'
         12        ROPE_END                                      3  ~23     ~24, !0
         13        ASSIGN                                                   !2, ~23
   14    14        INIT_FCALL                                               'get_headers'
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $27     
         18        ASSIGN                                                   !3, $27
   15    19        FETCH_DIM_R                                      ~29     !5, 'Location'
         20        ASSIGN                                                   !4, ~29
   16    21        INIT_FCALL_BY_NAME                                       'modify_url'
         22        SEND_VAL_EX                                              <array>
         23        SEND_VAR_EX                                              !4
         24        DO_FCALL                                      0  $31     
         25        ASSIGN                                                   !4, $31
   17    26        INIT_FCALL                                               'str_replace'
         27        SEND_VAL                                                 '%2F%2Ftracks'
         28        SEND_VAL                                                 '%2Ftracks'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                         $33     
         31        ASSIGN                                                   !4, $33
   19    32        INIT_FCALL                                               'file_get_contents'
         33        SEND_VAR                                                 !4
         34        DO_ICALL                                         $35     
         35        ASSIGN                                                   !6, $35
   20    36        INIT_FCALL                                               'json_decode'
         37        SEND_VAR                                                 !6
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $37     
         40        ASSIGN                                                   !7, $37
   21    41        FETCH_DIM_R                                      ~39     !7, 'stream_url'
         42        NOP                                                      
         43        FAST_CONCAT                                      ~40     '%3Fclient_id%3D', !0
         44        CONCAT                                           ~41     ~39, ~40
         45        ASSIGN                                                   !8, ~41
   22    46        FETCH_DIM_R                                      ~43     !7, 'id'
         47        ASSIGN                                                   !9, ~43
   23    48        INIT_FCALL                                               'get_headers'
         49        SEND_VAR                                                 !8
         50        SEND_VAL                                                 1
         51        DO_ICALL                                         $45     
         52        ASSIGN                                                   !10, $45
   24    53        FETCH_DIM_R                                      ~47     !10, 'Location'
         54        ASSIGN                                                   !11, ~47
   25    55        FETCH_R                      global              ~49     '_GET'
         56        FETCH_DIM_R                                      ~50     ~49, 'd'
         57        BOOL_NOT                                         ~51     ~50
         58      > JMPZ                                                     ~51, ->62
   26    59    >   ECHO                                                     !9
   27    60        ECHO                                                     !7
         61      > JMP                                                      ->84
   29    62    >   INIT_FCALL                                               'file_get_contents'
         63        SEND_VAR                                                 !11
         64        DO_ICALL                                         $52     
         65        ASSIGN                                                   !12, $52
   30    66        INIT_FCALL                                               'rand'
         67        SEND_VAL                                                 1
         68        SEND_VAL                                                 100000
         69        DO_ICALL                                         $54     
         70        ASSIGN                                                   !13, $54
   32    71        CONCAT                                           ~56     'files%2F', !9
         72        CONCAT                                           ~57     ~56, '-'
         73        CONCAT                                           ~58     ~57, !13
         74        CONCAT                                           ~59     ~58, '.mp3'
         75        ASSIGN                                                   !14, ~59
   33    76        INIT_FCALL                                               'file_put_contents'
         77        SEND_VAR                                                 !14
         78        SEND_VAR                                                 !12
         79        DO_ICALL                                                 
   34    80        ROPE_INIT                                     3  ~63     '%3Ca+href%3D'
         81        ROPE_ADD                                      1  ~63     ~63, !14
         82        ROPE_END                                      2  ~62     ~63, '%3Edownload%3C%2Fa%3E'
         83        ECHO                                                     ~62
   37    84    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.21 ms | 1404 KiB | 25 Q