3v4l.org

run code in 300+ PHP versions simultaneously
<?php unlink('/tmp/test.phar'); $phar = new Phar('/tmp/test.phar'); $phar->startBuffering(); $phar->addFromString('1.php', 'test'); $phar->addFromString('2.php', 'test'); $phar->addFromString('inner/3.php', 'test'); $phar->stopBuffering(); $phar->rewind(); // string(24) "phar:///tmp/test.phar/" var_dump($phar->key()); // Не выведет ничего // foreach ($phar as $k => $v) { /* ... */ } // А так выведет foreach ($phar->getChildren() as $k => $v) { var_dump($k); var_dump($v); } // А так выведет даже с подкаталогами $iter = new RecursiveIteratorIterator($phar->getChildren()); foreach ($iter as $k => $v) { var_dump($k); var_dump($v); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 42
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 42
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 42
2 jumps found. (Code = 77) Position 1 = 50, Position 2 = 59
Branch analysis from position: 50
2 jumps found. (Code = 78) Position 1 = 51, Position 2 = 59
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 42
filename:       /in/YvbU3
function name:  (null)
number of ops:  61
compiled vars:  !0 = $phar, !1 = $v, !2 = $k, !3 = $iter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'unlink'
          1        SEND_VAL                                                 '%2Ftmp%2Ftest.phar'
          2        DO_ICALL                                                 
    4     3        NEW                                              $5      'Phar'
          4        SEND_VAL_EX                                              '%2Ftmp%2Ftest.phar'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $5
    5     7        INIT_METHOD_CALL                                         !0, 'startBuffering'
          8        DO_FCALL                                      0          
    6     9        INIT_METHOD_CALL                                         !0, 'addFromString'
         10        SEND_VAL_EX                                              '1.php'
         11        SEND_VAL_EX                                              'test'
         12        DO_FCALL                                      0          
    7    13        INIT_METHOD_CALL                                         !0, 'addFromString'
         14        SEND_VAL_EX                                              '2.php'
         15        SEND_VAL_EX                                              'test'
         16        DO_FCALL                                      0          
    8    17        INIT_METHOD_CALL                                         !0, 'addFromString'
         18        SEND_VAL_EX                                              'inner%2F3.php'
         19        SEND_VAL_EX                                              'test'
         20        DO_FCALL                                      0          
    9    21        INIT_METHOD_CALL                                         !0, 'stopBuffering'
         22        DO_FCALL                                      0          
   10    23        INIT_METHOD_CALL                                         !0, 'rewind'
         24        DO_FCALL                                      0          
   13    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !0, 'key'
         27        DO_FCALL                                      0  $14     
         28        SEND_VAR                                                 $14
         29        DO_ICALL                                                 
   19    30        INIT_METHOD_CALL                                         !0, 'getChildren'
         31        DO_FCALL                                      0  $16     
         32      > FE_RESET_R                                       $17     $16, ->42
         33    > > FE_FETCH_R                                       ~18     $17, !1, ->42
         34    >   ASSIGN                                                   !2, ~18
   20    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                                 
   21    38        INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                                 
   19    41      > JMP                                                      ->33
         42    >   FE_FREE                                                  $17
   25    43        NEW                                              $22     'RecursiveIteratorIterator'
         44        INIT_METHOD_CALL                                         !0, 'getChildren'
         45        DO_FCALL                                      0  $23     
         46        SEND_VAR_NO_REF_EX                                       $23
         47        DO_FCALL                                      0          
         48        ASSIGN                                                   !3, $22
   26    49      > FE_RESET_R                                       $26     !3, ->59
         50    > > FE_FETCH_R                                       ~27     $26, !1, ->59
         51    >   ASSIGN                                                   !2, ~27
   27    52        INIT_FCALL                                               'var_dump'
         53        SEND_VAR                                                 !2
         54        DO_ICALL                                                 
   28    55        INIT_FCALL                                               'var_dump'
         56        SEND_VAR                                                 !1
         57        DO_ICALL                                                 
   26    58      > JMP                                                      ->50
         59    >   FE_FREE                                                  $26
   29    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.74 ms | 1004 KiB | 15 Q