3v4l.org

run code in 300+ PHP versions simultaneously
<?php function downloadFile($filename){ $Url = "http://tvfhls-a.akamaihd.net/1440927936/hls/1536/$filename"; echo "Downloading " . $Url . "\n"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $Url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $out = curl_exec($ch); curl_close($ch); $fp = fopen($filename, 'w'); fwrite($fp, $out); fclose($fp); } $filename = "Pitchers_EP5_v3_5mbps.m3u8"; downloadFile($filename); for($i=0; $i < 1698; $i ++ ) { $filename = "Pitchers_EP5_v3_5mbps$i.ts"; downloadFile($filename); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/2rK0D
function name:  (null)
number of ops:  17
compiled vars:  !0 = $filename, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, 'Pitchers_EP5_v3_5mbps.m3u8'
   20     1        INIT_FCALL                                               'downloadfile'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   21     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->14
   22     6    >   ROPE_INIT                                     3  ~6      'Pitchers_EP5_v3_5mbps'
          7        ROPE_ADD                                      1  ~6      ~6, !1
          8        ROPE_END                                      2  ~5      ~6, '.ts'
          9        ASSIGN                                                   !0, ~5
   23    10        INIT_FCALL                                               'downloadfile'
         11        SEND_VAR                                                 !0
         12        DO_FCALL                                      0          
   21    13        PRE_INC                                                  !1
         14    >   IS_SMALLER                                               !1, 1698
         15      > JMPNZ                                                    ~11, ->6
   26    16    > > RETURN                                                   1

Function downloadfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2rK0D
function name:  downloadFile
number of ops:  48
compiled vars:  !0 = $filename, !1 = $Url, !2 = $ch, !3 = $out, !4 = $fp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NOP                                                      
          2        FAST_CONCAT                                      ~5      'http%3A%2F%2Ftvfhls-a.akamaihd.net%2F1440927936%2Fhls%2F1536%2F', !0
          3        ASSIGN                                                   !1, ~5
    5     4        CONCAT                                           ~7      'Downloading+', !1
          5        CONCAT                                           ~8      ~7, '%0A'
          6        ECHO                                                     ~8
    6     7        INIT_FCALL_BY_NAME                                       'curl_init'
          8        DO_FCALL                                      0  $9      
          9        ASSIGN                                                   !2, $9
    7    10        INIT_FCALL_BY_NAME                                       'curl_setopt'
         11        SEND_VAR_EX                                              !2
         12        FETCH_CONSTANT                                   ~11     'CURLOPT_URL'
         13        SEND_VAL_EX                                              ~11
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
    8    16        INIT_FCALL_BY_NAME                                       'curl_setopt'
         17        SEND_VAR_EX                                              !2
         18        FETCH_CONSTANT                                   ~13     'CURLOPT_RETURNTRANSFER'
         19        SEND_VAL_EX                                              ~13
         20        SEND_VAL_EX                                              1
         21        DO_FCALL                                      0          
    9    22        INIT_FCALL_BY_NAME                                       'curl_setopt'
         23        SEND_VAR_EX                                              !2
         24        FETCH_CONSTANT                                   ~15     'CURLOPT_HEADER'
         25        SEND_VAL_EX                                              ~15
         26        SEND_VAL_EX                                              0
         27        DO_FCALL                                      0          
   11    28        INIT_FCALL_BY_NAME                                       'curl_exec'
         29        SEND_VAR_EX                                              !2
         30        DO_FCALL                                      0  $17     
         31        ASSIGN                                                   !3, $17
   12    32        INIT_FCALL_BY_NAME                                       'curl_close'
         33        SEND_VAR_EX                                              !2
         34        DO_FCALL                                      0          
   13    35        INIT_FCALL                                               'fopen'
         36        SEND_VAR                                                 !0
         37        SEND_VAL                                                 'w'
         38        DO_ICALL                                         $20     
         39        ASSIGN                                                   !4, $20
   14    40        INIT_FCALL                                               'fwrite'
         41        SEND_VAR                                                 !4
         42        SEND_VAR                                                 !3
         43        DO_ICALL                                                 
   15    44        INIT_FCALL                                               'fclose'
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                                 
   16    47      > RETURN                                                   null

End of function downloadfile

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.76 ms | 1402 KiB | 21 Q