3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clearAllCache($path) { $is_dot = array ('.', '..'); if (is_dir($path)) { if (version_compare(phpversion(), '5.3', '<')) { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST ); } else { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST ); } foreach ($iterator as $file) { if (version_compare(phpversion(), '5.2.17', '<=')) { if (in_array($file->getBasename(), $is_dot)) continue; } elseif (version_compare(phpversion(), '5.3', '<')) { if ($file->isDot()) continue; } if ($file->getBasename() !== 'index.php') unlink($file->getPathname()); } unset($iterator, $file); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sDQqC
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E > > RETURN                                                   1

Function clearallcache:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 76
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 73
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 73
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 51
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 72
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 72
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 63
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 63
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 63
Branch analysis from position: 63
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 73
Branch analysis from position: 33
Branch analysis from position: 73
Branch analysis from position: 76
filename:       /in/sDQqC
function name:  clearAllCache
number of ops:  77
compiled vars:  !0 = $path, !1 = $is_dot, !2 = $iterator, !3 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'is_dir'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5      > JMPZ                                                     $5, ->76
    8     6    >   INIT_FCALL                                               'version_compare'
          7        INIT_FCALL                                               'phpversion'
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        SEND_VAL                                                 '5.3'
         11        SEND_VAL                                                 '%3C'
         12        DO_ICALL                                         $7      
         13      > JMPZ                                                     $7, ->23
   10    14    >   NEW                                              $8      'RecursiveIteratorIterator'
   11    15        NEW                                              $9      'RecursiveDirectoryIterator'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $9
   12    19        SEND_VAL_EX                                              1
         20        DO_FCALL                                      0          
   10    21        ASSIGN                                                   !2, $8
         22      > JMP                                                      ->32
   17    23    >   NEW                                              $13     'RecursiveIteratorIterator'
   18    24        NEW                                              $14     'RecursiveDirectoryIterator'
         25        SEND_VAR_EX                                              !0
         26        SEND_VAL_EX                                              4096
         27        DO_FCALL                                      0          
         28        SEND_VAR_NO_REF_EX                                       $14
   19    29        SEND_VAL_EX                                              2
         30        DO_FCALL                                      0          
   17    31        ASSIGN                                                   !2, $13
   23    32    > > FE_RESET_R                                       $18     !2, ->73
         33    > > FE_FETCH_R                                               $18, !3, ->73
   25    34    >   INIT_FCALL                                               'version_compare'
         35        INIT_FCALL                                               'phpversion'
         36        DO_ICALL                                         $19     
         37        SEND_VAR                                                 $19
         38        SEND_VAL                                                 '5.2.17'
         39        SEND_VAL                                                 '%3C%3D'
         40        DO_ICALL                                         $20     
         41      > JMPZ                                                     $20, ->51
   27    42    >   INIT_FCALL                                               'in_array'
         43        INIT_METHOD_CALL                                         !3, 'getBasename'
         44        DO_FCALL                                      0  $21     
         45        SEND_VAR                                                 $21
         46        SEND_VAR                                                 !1
         47        DO_ICALL                                         $22     
         48      > JMPZ                                                     $22, ->50
   28    49    > > JMP                                                      ->33
         50    > > JMP                                                      ->63
   30    51    >   INIT_FCALL                                               'version_compare'
         52        INIT_FCALL                                               'phpversion'
         53        DO_ICALL                                         $23     
         54        SEND_VAR                                                 $23
         55        SEND_VAL                                                 '5.3'
         56        SEND_VAL                                                 '%3C'
         57        DO_ICALL                                         $24     
         58      > JMPZ                                                     $24, ->63
   32    59    >   INIT_METHOD_CALL                                         !3, 'isDot'
         60        DO_FCALL                                      0  $25     
         61      > JMPZ                                                     $25, ->63
   33    62    > > JMP                                                      ->33
   35    63    >   INIT_METHOD_CALL                                         !3, 'getBasename'
         64        DO_FCALL                                      0  $26     
         65        IS_NOT_IDENTICAL                                         $26, 'index.php'
         66      > JMPZ                                                     ~27, ->72
   36    67    >   INIT_FCALL                                               'unlink'
         68        INIT_METHOD_CALL                                         !3, 'getPathname'
         69        DO_FCALL                                      0  $28     
         70        SEND_VAR                                                 $28
         71        DO_ICALL                                                 
   23    72    > > JMP                                                      ->33
         73    >   FE_FREE                                                  $18
   38    74        UNSET_CV                                                 !2
         75        UNSET_CV                                                 !3
   40    76    > > RETURN                                                   null

End of function clearallcache

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.87 ms | 1404 KiB | 23 Q