3v4l.org

run code in 300+ PHP versions simultaneously
<?php class file_Manager { protected $name = 'File '; protected $version = '0.111'; private $files = []; public function output($node) { $this->recursive_hash('/'); return json_encode($this->files); } private function recursive_hash($full_dir='') { $return = array(); if ($full_dir == '') { $full_dir = ''; } $d = dir($full_dir); while (false !== ($entry = $d->read())) { if ($entry == '.' or $entry == '..') continue; $file = $full_dir.$entry; if (is_dir($file)) { $return[] = $this->recursive_hash($full_dir); } $this->files[] = $file; } return $return; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aTrJo
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E > > RETURN                                                   1

Class file_Manager:
Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aTrJo
function name:  output
number of ops:  10
compiled vars:  !0 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_METHOD_CALL                                         'recursive_hash'
          2        SEND_VAL_EX                                              '%2F'
          3        DO_FCALL                                      0          
   11     4        INIT_FCALL                                               'json_encode'
          5        FETCH_OBJ_R                                      ~2      'files'
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
   12     9*     > RETURN                                                   null

End of function output

Function recursive_hash:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 10
Branch analysis from position: 35
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 = 30
Branch analysis from position: 30
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 10
Branch analysis from position: 35
Branch analysis from position: 10
Branch analysis from position: 27
Branch analysis from position: 14
Branch analysis from position: 5
filename:       /in/aTrJo
function name:  recursive_hash
number of ops:  37
compiled vars:  !0 = $full_dir, !1 = $return, !2 = $d, !3 = $entry, !4 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV_INIT                                        !0      ''
   15     1        ASSIGN                                                   !1, <array>
   17     2        IS_EQUAL                                                 !0, ''
          3      > JMPZ                                                     ~6, ->5
   18     4    >   ASSIGN                                                   !0, ''
   21     5    >   INIT_FCALL                                               'dir'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
   23     9      > JMP                                                      ->30
   24    10    >   IS_EQUAL                                         ~10     !3, '.'
         11      > JMPNZ_EX                                         ~10     ~10, ->14
         12    >   IS_EQUAL                                         ~11     !3, '..'
         13        BOOL                                             ~10     ~11
         14    > > JMPZ                                                     ~10, ->16
         15    > > JMP                                                      ->30
   26    16    >   CONCAT                                           ~12     !0, !3
         17        ASSIGN                                                   !4, ~12
   27    18        INIT_FCALL                                               'is_dir'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $14     
         21      > JMPZ                                                     $14, ->27
   28    22    >   INIT_METHOD_CALL                                         'recursive_hash'
         23        SEND_VAR                                                 !0
         24        DO_FCALL                                      0  $16     
         25        ASSIGN_DIM                                               !1
         26        OP_DATA                                                  $16
   31    27    >   FETCH_OBJ_W                                      $17     'files'
         28        ASSIGN_DIM                                               $17
         29        OP_DATA                                                  !4
   23    30    >   INIT_METHOD_CALL                                         !2, 'read'
         31        DO_FCALL                                      0  $19     
         32        ASSIGN                                           ~20     !3, $19
         33        TYPE_CHECK                                  1018          ~20
         34      > JMPNZ                                                    ~21, ->10
   34    35    > > RETURN                                                   !1
   35    36*     > RETURN                                                   null

End of function recursive_hash

End of class file_Manager.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.13 ms | 1400 KiB | 19 Q