3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Vloží všetky súbory v zadanom adresári do volajúceho skriptu * a pokúsi sa ich spracovať ako PHP kód (nezáleží na prípone). * * @author Jakub Kubíček <kelerest123@gmail.com> * * @param string adresár z ktorého sa majú načítať súbory * @param array vložia sa iba vymenované súbory (voliteľný) * @return void * @throws DomainException ak adresár alebo niektorý/é zo zadaných súborov v druhom parametri neexistuje * */ function includeRecursive($dir, $files = array()) { if(!is_dir($dir) || !$dh = opendir($dir)) throw new DomainException(); array_walk($files, function($item) use($dir) { $path = $dir . PATH_SEPARATOR . $item; if(!is_file($path)) throw new DomainException(); }); if(count($files)) { foreach($files as $file) require($dir . PATH_SEPARATOR . $item); } else { while($file = readdir($dh) !== false) { if(is_file($file)) require($file); } } closedir($dh); //return; } includeRecursive('/');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkBA7
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   INIT_FCALL                                               'includerecursive'
          1        SEND_VAL                                                 '%2F'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function includerecursive:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 34
Branch analysis from position: 45
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 34
Branch analysis from position: 45
Branch analysis from position: 34
Branch analysis from position: 39
Branch analysis from position: 13
filename:       /in/qkBA7
function name:  includeRecursive
number of ops:  49
compiled vars:  !0 = $dir, !1 = $files, !2 = $dh, !3 = $file, !4 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
   17     2        INIT_FCALL                                               'is_dir'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        BOOL_NOT                                         ~6      $5
          6      > JMPNZ_EX                                         ~6      ~6, ->13
          7    >   INIT_FCALL                                               'opendir'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        ASSIGN                                           ~8      !2, $7
         11        BOOL_NOT                                         ~9      ~8
         12        BOOL                                             ~6      ~9
         13    > > JMPZ                                                     ~6, ->17
         14    >   NEW                                              $10     'DomainException'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $10
   19    17    >   INIT_FCALL                                               'array_walk'
         18        SEND_REF                                                 !1
         19        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqkBA7%3A19%240'
         20        BIND_LEXICAL                                             ~12, !0
   22    21        SEND_VAL                                                 ~12
         22        DO_ICALL                                                 
   24    23        COUNT                                            ~14     !1
         24      > JMPZ                                                     ~14, ->33
   25    25    > > FE_RESET_R                                       $15     !1, ->31
         26    > > FE_FETCH_R                                               $15, !3, ->31
         27    >   CONCAT                                           ~16     !0, '%3A'
         28        CONCAT                                           ~17     ~16, !4
         29        INCLUDE_OR_EVAL                                          ~17, REQUIRE
         30      > JMP                                                      ->26
         31    >   FE_FREE                                                  $15
         32      > JMP                                                      ->45
   27    33    > > JMP                                                      ->39
   28    34    >   INIT_FCALL                                               'is_file'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                         $19     
         37      > JMPZ                                                     $19, ->39
         38    >   INCLUDE_OR_EVAL                                          !3, REQUIRE
   27    39    >   INIT_FCALL                                               'readdir'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                         $21     
         42        TYPE_CHECK                                  1018  ~22     $21
         43        ASSIGN                                           ~23     !3, ~22
         44      > JMPNZ                                                    ~23, ->34
   32    45    >   INIT_FCALL                                               'closedir'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                                 
   34    48      > RETURN                                                   null

End of function includerecursive

Function %00%7Bclosure%7D%2Fin%2FqkBA7%3A19%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkBA7
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $item, !1 = $dir, !2 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   20     2        CONCAT                                           ~3      !1, '%3A'
          3        CONCAT                                           ~4      ~3, !0
          4        ASSIGN                                                   !2, ~4
   21     5        INIT_FCALL                                               'is_file'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8        BOOL_NOT                                         ~7      $6
          9      > JMPZ                                                     ~7, ->13
         10    >   NEW                                              $8      'DomainException'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $8
   22    13    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqkBA7%3A19%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.77 ms | 1407 KiB | 26 Q