3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stream = 'skwjr'; $url = sprintf('https://api.twitch.tv/api/channels/' . $stream . '/access_token/'); $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/7EQ2J
function name:  (null)
number of ops:  30
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, 'skwjr'
    4     1        INIT_FCALL                                               'sprintf'
          2        CONCAT                                           ~7      'https%3A%2F%2Fapi.twitch.tv%2Fapi%2Fchannels%2F', !0
          3        CONCAT                                           ~8      ~7, '%2Faccess_token%2F'
          4        SEND_VAL                                                 ~8
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !1, $9
    5     7        INIT_FCALL                                               'file_get_contents'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !2, $11
    6    11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !3, $13
    7    16        FETCH_DIM_R                                      ~15     !3, 'token'
         17        ASSIGN                                                   !4, ~15
    8    18        FETCH_DIM_R                                      ~17     !3, 'sig'
         19        ASSIGN                                                   !5, ~17
    9    20        CONCAT                                           ~19     'http%3A%2F%2Fusher.twitch.tv%2Fapi%2Fchannel%2Fhls%2F', !0
         21        CONCAT                                           ~20     ~19, '.m3u8%3Fplayer%3Dtwitchweb%26token%3D'
         22        INIT_FCALL                                               'rawurlencode'
         23        SEND_VAR                                                 !4
         24        DO_ICALL                                         $21     
         25        CONCAT                                           ~22     ~20, $21
         26        CONCAT                                           ~23     ~22, '%26sig%3D'
         27        CONCAT                                           ~24     ~23, !5
         28        ECHO                                                     ~24
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.7 ms | 1396 KiB | 21 Q