3v4l.org

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

Function rec:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 7
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 7
Branch analysis from position: 33
Branch analysis from position: 7
Branch analysis from position: 29
Branch analysis from position: 11
filename:       /in/W3SEg
function name:  rec
number of ops:  34
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      > JMP                                                      ->29
    5     7    >   IS_EQUAL                                         ~6      !3, '.'
          8      > JMPNZ_EX                                         ~6      ~6, ->11
          9    >   IS_EQUAL                                         ~7      !3, '..'
         10        BOOL                                             ~6      ~7
         11    > > JMPZ                                                     ~6, ->13
         12    > > JMP                                                      ->29
    6    13    >   CONCAT                                           ~8      !1, !3
         14        CONCAT                                           ~9      ~8, '%0A'
         15        ECHO                                                     ~9
    7    16        INIT_FCALL                                               'is_dir'
         17        CONCAT                                           ~10     !0, '%2F'
         18        CONCAT                                           ~11     ~10, !3
         19        SEND_VAL                                                 ~11
         20        DO_ICALL                                         $12     
         21      > JMPZ                                                     $12, ->29
    8    22    >   INIT_FCALL_BY_NAME                                       'rec'
         23        CONCAT                                           ~13     !0, '%2F'
         24        CONCAT                                           ~14     ~13, !3
         25        SEND_VAL_EX                                              ~14
         26        CONCAT                                           ~15     !1, '++'
         27        SEND_VAL_EX                                              ~15
         28        DO_FCALL                                      0          
    4    29    >   INIT_METHOD_CALL                                         !2, 'read'
         30        DO_FCALL                                      0  $17     
         31        ASSIGN                                           ~18     !3, $17
         32      > JMPNZ                                                    ~18, ->7
   11    33    > > RETURN                                                   null

End of function rec

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.93 ms | 1403 KiB | 18 Q