3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rec($dir, $depth) { $d = dir($dir); if (!$d) return; while ($entry = $d->read()) { if ($entry == '.' || $entry == '..') continue; echo $depth . $entry . "\n"; if (is_dir($dir . '/' . $entry)) { rec($dir . '/' . $entry, $depth . " "); } } } rec('/Users/stepanenko', '');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5ZB6N
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'rec'
          1        SEND_VAL                                                 '%2FUsers%2Fstepanenko'
          2        SEND_VAL                                                 ''
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function rec:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 10
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 10
Branch analysis from position: 36
Branch analysis from position: 10
Branch analysis from position: 32
Branch analysis from position: 14
filename:       /in/5ZB6N
function name:  rec
number of ops:  37
compiled vars:  !0 = $dir, !1 = $depth, !2 = $d, !3 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        INIT_FCALL                                               'dir'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !2, $4
    4     6        BOOL_NOT                                         ~6      !2
          7      > JMPZ                                                     ~6, ->9
          8    > > RETURN                                                   null
    5     9    > > JMP                                                      ->32
    6    10    >   IS_EQUAL                                         ~7      !3, '.'
         11      > JMPNZ_EX                                         ~7      ~7, ->14
         12    >   IS_EQUAL                                         ~8      !3, '..'
         13        BOOL                                             ~7      ~8
         14    > > JMPZ                                                     ~7, ->16
         15    > > JMP                                                      ->32
    7    16    >   CONCAT                                           ~9      !1, !3
         17        CONCAT                                           ~10     ~9, '%0A'
         18        ECHO                                                     ~10
    8    19        INIT_FCALL                                               'is_dir'
         20        CONCAT                                           ~11     !0, '%2F'
         21        CONCAT                                           ~12     ~11, !3
         22        SEND_VAL                                                 ~12
         23        DO_ICALL                                         $13     
         24      > JMPZ                                                     $13, ->32
    9    25    >   INIT_FCALL_BY_NAME                                       'rec'
         26        CONCAT                                           ~14     !0, '%2F'
         27        CONCAT                                           ~15     ~14, !3
         28        SEND_VAL_EX                                              ~15
         29        CONCAT                                           ~16     !1, '++'
         30        SEND_VAL_EX                                              ~16
         31        DO_FCALL                                      0          
    5    32    >   INIT_METHOD_CALL                                         !2, 'read'
         33        DO_FCALL                                      0  $18     
         34        ASSIGN                                           ~19     !3, $18
         35      > JMPNZ                                                    ~19, ->10
   12    36    > > RETURN                                                   null

End of function rec

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.3 ms | 1403 KiB | 18 Q