3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://www.example.com'; $fp = fopen($url, 'r'); $meta_data = stream_get_meta_data($fp); foreach ($meta_data['wrapper_data'] as $response) { /* Были ли мы переадресованы? */ if (strtolower(substr($response, 0, 10)) == 'location: ') { /* Сохранить в $url адрес, куда нас переадресовали */ $url = substr($response, 10); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 29
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 29
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 28
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/j10jr
function name:  (null)
number of ops:  31
compiled vars:  !0 = $url, !1 = $fp, !2 = $meta_data, !3 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.example.com'
    4     1        INIT_FCALL                                               'fopen'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'r'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        INIT_FCALL                                               'stream_get_meta_data'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
    7    10        FETCH_DIM_R                                      ~9      !2, 'wrapper_data'
         11      > FE_RESET_R                                       $10     ~9, ->29
         12    > > FE_FETCH_R                                               $10, !3, ->29
   10    13    >   INIT_FCALL                                               'strtolower'
         14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !3
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 10
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                         $12     
         21        IS_EQUAL                                                 $12, 'location%3A+'
         22      > JMPZ                                                     ~13, ->28
   13    23    >   INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !3
         25        SEND_VAL                                                 10
         26        DO_ICALL                                         $14     
         27        ASSIGN                                                   !0, $14
    7    28    > > JMP                                                      ->12
         29    >   FE_FREE                                                  $10
   18    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1388 KiB | 21 Q