3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = file_get_contents('https://www.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 = 25, Position 2 = 45
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 45
Branch analysis from position: 26
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 43
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 43
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 42
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 42
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 43
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
filename:       /in/n9f6v
function name:  (null)
number of ops:  47
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                                               'file_get_contents'
          1        SEND_VAL                                                 'https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Du7R4kdCi1zY'
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !0, $8
    4     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2Fytplayer.config+%3D+%7B%28.%2A%3F%29%7D%3B%2F'
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
    5     9        INIT_FCALL                                               'json_decode'
         10        FETCH_DIM_R                                      ~11     !1, 1
         11        CONCAT                                           ~12     '%7B', ~11
         12        CONCAT                                           ~13     ~12, '%7D'
         13        SEND_VAL                                                 ~13
         14        DO_ICALL                                         $14     
         15        ASSIGN                                                   !2, $14
    6    16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '%2C'
         18        FETCH_OBJ_R                                      ~16     !2, 'args'
         19        FETCH_OBJ_R                                      ~17     ~16, 'url_encoded_fmt_stream_map'
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                         $18     
         22        ASSIGN                                                   !3, $18
    8    23        ASSIGN                                                   !4, <array>
   10    24      > FE_RESET_R                                       $21     !4, ->45
         25    > > FE_FETCH_R                                               $21, !5, ->45
   11    26    > > FE_RESET_R                                       $22     !3, ->43
         27    > > FE_FETCH_R                                               $22, !6, ->43
   12    28    >   INIT_FCALL                                               'parse_str'
         29        SEND_VAR                                                 !6
         30        SEND_REF                                                 !7
         31        DO_ICALL                                                 
   13    32        FETCH_DIM_R                                      ~24     !7, 'itag'
         33        IS_EQUAL                                                 !5, ~24
         34      > JMPZ                                                     ~25, ->42
   14    35    >   FETCH_DIM_R                                      ~26     !7, 'url'
         36        CONCAT                                           ~27     '%3Ca+href%3D%22', ~26
         37        CONCAT                                           ~28     ~27, '%22%3Equality%3A+'
         38        FETCH_DIM_R                                      ~29     !7, 'itag'
         39        CONCAT                                           ~30     ~28, ~29
         40        CONCAT                                           ~31     ~30, '%3C%2Fa%3E%3Cbr+%2F%3E'
         41        ECHO                                                     ~31
   11    42    > > JMP                                                      ->27
         43    >   FE_FREE                                                  $22
   10    44      > JMP                                                      ->25
         45    >   FE_FREE                                                  $21
   16    46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155 ms | 1400 KiB | 23 Q