3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users = array(); $homepaths = array(); $configlist = array( 'config.php', 'config.inc.php', 'db.inc.php', 'connect.php', 'wp-config.php', 'var.php', 'configure.php', 'database.php', 'db.php', 'configuration.php', 'db_connect.php'); $var = '/var/mail/'; if (is_readable($var) & is_dir($var)) { $userlist = rglob('{*}', GLOB_BRACE, $var); } else { die("cant grab users from {$var}"); } if (!empty($userlist)) { foreach ($userlist as $user) { array_push($users, preg_replace('/^.+[\\\\\\/]/', '', $user)); } } foreach ($users as $usr) { $path = "/home/{$usr}/public_html/"; if (is_dir($path)) { array_push($homepaths, $path); } } foreach ($homepaths as $home) { if (is_dir($home)) { $fileList = rglob('{*.php}', GLOB_BRACE, $home); if (!empty($fileList)) { foreach ($fileList as $f) { //if (in_array(preg_replace('/^.+[\\\\\\/]/', '', $f), $configlist)) { echo $f; // } } } } } /* rglob func borrowed from https://github.com/hm2k/hm2k-php/blob/master/functions/rglob.php */ function rglob($pattern = '*', $flags = 0, $path = '') { $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT); $files = glob($path . $pattern, $flags); foreach ($paths as $path) { $files = array_merge($files, rglob($pattern, $flags, $path)); } return $files; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 37
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 37
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 53
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 53
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 52
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 52
Branch analysis from position: 53
2 jumps found. (Code = 77) Position 1 = 55, Position 2 = 75
Branch analysis from position: 55
2 jumps found. (Code = 78) Position 1 = 56, Position 2 = 75
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 74
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 74
Branch analysis from position: 69
2 jumps found. (Code = 77) Position 1 = 70, Position 2 = 73
Branch analysis from position: 70
2 jumps found. (Code = 78) Position 1 = 71, Position 2 = 73
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 73
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
Branch analysis from position: 73
Branch analysis from position: 74
Branch analysis from position: 74
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 75
Branch analysis from position: 53
Branch analysis from position: 37
Branch analysis from position: 38
Branch analysis from position: 19
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/KYZJo
function name:  (null)
number of ops:  77
compiled vars:  !0 = $users, !1 = $homepaths, !2 = $configlist, !3 = $var, !4 = $userlist, !5 = $user, !6 = $usr, !7 = $path, !8 = $home, !9 = $fileList, !10 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
   18     3        ASSIGN                                                   !3, '%2Fvar%2Fmail%2F'
   19     4        INIT_FCALL                                               'is_readable'
          5        SEND_VAR                                                 !3
          6        DO_ICALL                                         $15     
          7        INIT_FCALL                                               'is_dir'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $16     
         10        BW_AND                                           ~17     $15, $16
         11      > JMPZ                                                     ~17, ->19
   20    12    >   INIT_FCALL_BY_NAME                                       'rglob'
         13        SEND_VAL_EX                                              '%7B%2A%7D'
         14        SEND_VAL_EX                                              1024
         15        SEND_VAR_EX                                              !3
         16        DO_FCALL                                      0  $18     
         17        ASSIGN                                                   !4, $18
         18      > JMP                                                      ->22
   22    19    >   NOP                                                      
         20        FAST_CONCAT                                      ~20     'cant+grab+users+from+', !3
         21      > EXIT                                                     ~20
   24    22    >   ISSET_ISEMPTY_CV                                 ~21     !4
         23        BOOL_NOT                                         ~22     ~21
         24      > JMPZ                                                     ~22, ->38
   25    25    > > FE_RESET_R                                       $23     !4, ->37
         26    > > FE_FETCH_R                                               $23, !5, ->37
   26    27    >   INIT_FCALL                                               'array_push'
         28        SEND_REF                                                 !0
         29        INIT_FCALL                                               'preg_replace'
         30        SEND_VAL                                                 '%2F%5E.%2B%5B%5C%5C%5C%2F%5D%2F'
         31        SEND_VAL                                                 ''
         32        SEND_VAR                                                 !5
         33        DO_ICALL                                         $24     
         34        SEND_VAR                                                 $24
         35        DO_ICALL                                                 
   25    36      > JMP                                                      ->26
         37    >   FE_FREE                                                  $23
   29    38    > > FE_RESET_R                                       $26     !0, ->53
         39    > > FE_FETCH_R                                               $26, !6, ->53
   30    40    >   ROPE_INIT                                     3  ~28     '%2Fhome%2F'
         41        ROPE_ADD                                      1  ~28     ~28, !6
         42        ROPE_END                                      2  ~27     ~28, '%2Fpublic_html%2F'
         43        ASSIGN                                                   !7, ~27
   31    44        INIT_FCALL                                               'is_dir'
         45        SEND_VAR                                                 !7
         46        DO_ICALL                                         $31     
         47      > JMPZ                                                     $31, ->52
   32    48    >   INIT_FCALL                                               'array_push'
         49        SEND_REF                                                 !1
         50        SEND_VAR                                                 !7
         51        DO_ICALL                                                 
   29    52    > > JMP                                                      ->39
         53    >   FE_FREE                                                  $26
   35    54      > FE_RESET_R                                       $33     !1, ->75
         55    > > FE_FETCH_R                                               $33, !8, ->75
   36    56    >   INIT_FCALL                                               'is_dir'
         57        SEND_VAR                                                 !8
         58        DO_ICALL                                         $34     
         59      > JMPZ                                                     $34, ->74
   37    60    >   INIT_FCALL_BY_NAME                                       'rglob'
         61        SEND_VAL_EX                                              '%7B%2A.php%7D'
         62        SEND_VAL_EX                                              1024
         63        SEND_VAR_EX                                              !8
         64        DO_FCALL                                      0  $35     
         65        ASSIGN                                                   !9, $35
   38    66        ISSET_ISEMPTY_CV                                 ~37     !9
         67        BOOL_NOT                                         ~38     ~37
         68      > JMPZ                                                     ~38, ->74
   39    69    > > FE_RESET_R                                       $39     !9, ->73
         70    > > FE_FETCH_R                                               $39, !10, ->73
   41    71    >   ECHO                                                     !10
   39    72      > JMP                                                      ->70
         73    >   FE_FREE                                                  $39
   35    74    > > JMP                                                      ->55
         75    >   FE_FREE                                                  $33
   62    76      > RETURN                                                   1

Function rglob:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/KYZJo
function name:  rglob
number of ops:  31
compiled vars:  !0 = $pattern, !1 = $flags, !2 = $path, !3 = $paths, !4 = $files
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   RECV_INIT                                        !0      '%2A'
          1        RECV_INIT                                        !1      0
          2        RECV_INIT                                        !2      ''
   55     3        INIT_FCALL                                               'glob'
          4        CONCAT                                           ~5      !2, '%2A'
          5        SEND_VAL                                                 ~5
          6        SEND_VAL                                                 8198
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !3, $6
   56     9        INIT_FCALL                                               'glob'
         10        CONCAT                                           ~8      !2, !0
         11        SEND_VAL                                                 ~8
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !4, $9
   57    15      > FE_RESET_R                                       $11     !3, ->28
         16    > > FE_FETCH_R                                               $11, !2, ->28
   58    17    >   INIT_FCALL                                               'array_merge'
         18        SEND_VAR                                                 !4
         19        INIT_FCALL_BY_NAME                                       'rglob'
         20        SEND_VAR_EX                                              !0
         21        SEND_VAR_EX                                              !1
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0  $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                         $13     
         26        ASSIGN                                                   !4, $13
   57    27      > JMP                                                      ->16
         28    >   FE_FREE                                                  $11
   60    29      > RETURN                                                   !4
   61    30*     > RETURN                                                   null

End of function rglob

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.43 ms | 1408 KiB | 25 Q