3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stream = 'monstercat'; $url = sprintf('https://api.twitch.tv/api/channels/%s/access_token/', $stream); $page = file_get_contents($url); $json = json_decode($page, true); $token = $json['token']; $sig = $json['sig']; echo 'http://usher.twitch.tv/api/channel/hls/' . $stream . '.m3u8?player=twitchweb&token=' . rawurlencode($token) . '&sig=' . $sig;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fV1XQ
function name:  (null)
number of ops:  29
compiled vars:  !0 = $stream, !1 = $url, !2 = $page, !3 = $json, !4 = $token, !5 = $sig
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'monstercat'
    4     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 'https%3A%2F%2Fapi.twitch.tv%2Fapi%2Fchannels%2F%25s%2Faccess_token%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    5     6        INIT_FCALL                                               'file_get_contents'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
    6    10        INIT_FCALL                                               'json_decode'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !3, $11
    7    15        FETCH_DIM_R                                      ~13     !3, 'token'
         16        ASSIGN                                                   !4, ~13
    8    17        FETCH_DIM_R                                      ~15     !3, 'sig'
         18        ASSIGN                                                   !5, ~15
    9    19        CONCAT                                           ~17     'http%3A%2F%2Fusher.twitch.tv%2Fapi%2Fchannel%2Fhls%2F', !0
         20        CONCAT                                           ~18     ~17, '.m3u8%3Fplayer%3Dtwitchweb%26token%3D'
         21        INIT_FCALL                                               'rawurlencode'
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $19     
         24        CONCAT                                           ~20     ~18, $19
         25        CONCAT                                           ~21     ~20, '%26sig%3D'
         26        CONCAT                                           ~22     ~21, !5
         27        ECHO                                                     ~22
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.82 ms | 1395 KiB | 21 Q