3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ERROR); $data = file_get_contents('youtube.com/watch?v=u7R4kdCi1zY'); preg_match('/ytplayer.config = {(.*?)};/',$data,$match); $o = json_decode('{'.$match[1].'}') ; $links = explode(',',$o -> args -> url_encoded_fmt_stream_map); foreach($links as $link) { parse_str($link,$r); echo '<a href="'.$r['url'].'">quality: '.$r['itag'].'</a><br />'; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 40
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/8KLtG
function name:  (null)
number of ops:  42
compiled vars:  !0 = $data, !1 = $match, !2 = $o, !3 = $links, !4 = $link, !5 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 1
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'file_get_contents'
          4        SEND_VAL                                                 'youtube.com%2Fwatch%3Fv%3Du7R4kdCi1zY'
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !0, $7
    4     7        INIT_FCALL                                               'preg_match'
          8        SEND_VAL                                                 '%2Fytplayer.config+%3D+%7B%28.%2A%3F%29%7D%3B%2F'
          9        SEND_VAR                                                 !0
         10        SEND_REF                                                 !1
         11        DO_ICALL                                                 
    5    12        INIT_FCALL                                               'json_decode'
         13        FETCH_DIM_R                                      ~10     !1, 1
         14        CONCAT                                           ~11     '%7B', ~10
         15        CONCAT                                           ~12     ~11, '%7D'
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                         $13     
         18        ASSIGN                                                   !2, $13
    6    19        INIT_FCALL                                               'explode'
         20        SEND_VAL                                                 '%2C'
         21        FETCH_OBJ_R                                      ~15     !2, 'args'
         22        FETCH_OBJ_R                                      ~16     ~15, 'url_encoded_fmt_stream_map'
         23        SEND_VAL                                                 ~16
         24        DO_ICALL                                         $17     
         25        ASSIGN                                                   !3, $17
    7    26      > FE_RESET_R                                       $19     !3, ->40
         27    > > FE_FETCH_R                                               $19, !4, ->40
    8    28    >   INIT_FCALL                                               'parse_str'
         29        SEND_VAR                                                 !4
         30        SEND_REF                                                 !5
         31        DO_ICALL                                                 
    9    32        FETCH_DIM_R                                      ~21     !5, 'url'
         33        CONCAT                                           ~22     '%3Ca+href%3D%22', ~21
         34        CONCAT                                           ~23     ~22, '%22%3Equality%3A+'
         35        FETCH_DIM_R                                      ~24     !5, 'itag'
         36        CONCAT                                           ~25     ~23, ~24
         37        CONCAT                                           ~26     ~25, '%3C%2Fa%3E%3Cbr+%2F%3E'
         38        ECHO                                                     ~26
    7    39      > JMP                                                      ->27
         40    >   FE_FREE                                                  $19
   11    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.72 ms | 1400 KiB | 25 Q