3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ERROR); $data = file_get_contents('http://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); $numbers = array(17, 22, 36); foreach($numbers as $number) { foreach($links as $link) { parse_str($link,$r); if ($r['itag'] == $number) 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 = 28, Position 2 = 48
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 48
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 46
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 46
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 45
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 45
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 46
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/kupGq
function name:  (null)
number of ops:  50
compiled vars:  !0 = $data, !1 = $match, !2 = $o, !3 = $links, !4 = $numbers, !5 = $number, !6 = $link, !7 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 1
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'file_get_contents'
          4        SEND_VAL                                                 'http%3A%2F%2Fyoutube.com%2Fwatch%3Fv%3Du7R4kdCi1zY'
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !0, $9
    5     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                                                 
    6    12        INIT_FCALL                                               'json_decode'
         13        FETCH_DIM_R                                      ~12     !1, 1
         14        CONCAT                                           ~13     '%7B', ~12
         15        CONCAT                                           ~14     ~13, '%7D'
         16        SEND_VAL                                                 ~14
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !2, $15
    7    19        INIT_FCALL                                               'explode'
         20        SEND_VAL                                                 '%2C'
         21        FETCH_OBJ_R                                      ~17     !2, 'args'
         22        FETCH_OBJ_R                                      ~18     ~17, 'url_encoded_fmt_stream_map'
         23        SEND_VAL                                                 ~18
         24        DO_ICALL                                         $19     
         25        ASSIGN                                                   !3, $19
    9    26        ASSIGN                                                   !4, <array>
   11    27      > FE_RESET_R                                       $22     !4, ->48
         28    > > FE_FETCH_R                                               $22, !5, ->48
   12    29    > > FE_RESET_R                                       $23     !3, ->46
         30    > > FE_FETCH_R                                               $23, !6, ->46
   13    31    >   INIT_FCALL                                               'parse_str'
         32        SEND_VAR                                                 !6
         33        SEND_REF                                                 !7
         34        DO_ICALL                                                 
   14    35        FETCH_DIM_R                                      ~25     !7, 'itag'
         36        IS_EQUAL                                                 !5, ~25
         37      > JMPZ                                                     ~26, ->45
   15    38    >   FETCH_DIM_R                                      ~27     !7, 'url'
         39        CONCAT                                           ~28     '%3Ca+href%3D%22', ~27
         40        CONCAT                                           ~29     ~28, '%22%3Equality%3A+'
         41        FETCH_DIM_R                                      ~30     !7, 'itag'
         42        CONCAT                                           ~31     ~29, ~30
         43        CONCAT                                           ~32     ~31, '%3C%2Fa%3E%3Cbr+%2F%3E'
         44        ECHO                                                     ~32
   12    45    > > JMP                                                      ->30
         46    >   FE_FREE                                                  $23
   11    47      > JMP                                                      ->28
         48    >   FE_FREE                                                  $22
   17    49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.25 ms | 1400 KiB | 25 Q