3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rec($dir, $depth, $root) { $dir = dir('/dev/fd'); while ($entry = $dir->read()) { if ($entry == '.' || $entry == '..') continue; echo $depth . $entry . "\n"; if (is_dir($root . $entry)) { rec($dir, $depth . " ", $root . '/' . $entry); } } } rec('/', '', '/');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v9BZ4
function name:  (null)
number of ops:  6
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        SEND_VAL                                                 '%2F'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function rec

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.89 ms | 1407 KiB | 18 Q