3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ls($path = '.') { $d = opendir($path); while ($file = readdir($d)) { if (!in_array($file, array(".", "..")) && is_dir(($path == '.' ? "/" : $path."/").$file)) ls(($path == '.' ? "/" : $path."/").$file); echo $path."/".$file."\n"; } closedir($d); } ls();

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BlPGV
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'ls'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function ls:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 6
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 31
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 6
Branch analysis from position: 40
Branch analysis from position: 6
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 6
Branch analysis from position: 40
Branch analysis from position: 6
Branch analysis from position: 31
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 31
Branch analysis from position: 21
Branch analysis from position: 31
Branch analysis from position: 20
filename:       /in/BlPGV
function name:  ls
number of ops:  44
compiled vars:  !0 = $path, !1 = $d, !2 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      '.'
    5     1        INIT_FCALL                                               'opendir'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    6     5      > JMP                                                      ->35
    8     6    >   IN_ARRAY                                         ~5      !2, <array>
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ_EX                                          ~6      ~6, ->20
          9    >   INIT_FCALL                                               'is_dir'
         10        IS_EQUAL                                                 !0, '.'
         11      > JMPZ                                                     ~7, ->14
         12    >   QM_ASSIGN                                        ~8      '%2F'
         13      > JMP                                                      ->16
         14    >   CONCAT                                           ~9      !0, '%2F'
         15        QM_ASSIGN                                        ~8      ~9
         16    >   CONCAT                                           ~10     ~8, !2
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                         $11     
         19        BOOL                                             ~6      $11
         20    > > JMPZ                                                     ~6, ->31
    9    21    >   INIT_FCALL_BY_NAME                                       'ls'
         22        IS_EQUAL                                                 !0, '.'
         23      > JMPZ                                                     ~12, ->26
         24    >   QM_ASSIGN                                        ~13     '%2F'
         25      > JMP                                                      ->28
         26    >   CONCAT                                           ~14     !0, '%2F'
         27        QM_ASSIGN                                        ~13     ~14
         28    >   CONCAT                                           ~15     ~13, !2
         29        SEND_VAL_EX                                              ~15
         30        DO_FCALL                                      0          
   10    31    >   CONCAT                                           ~17     !0, '%2F'
         32        CONCAT                                           ~18     ~17, !2
         33        CONCAT                                           ~19     ~18, '%0A'
         34        ECHO                                                     ~19
    6    35    >   INIT_FCALL                                               'readdir'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                         $20     
         38        ASSIGN                                           ~21     !2, $20
         39      > JMPNZ                                                    ~21, ->6
   12    40    >   INIT_FCALL                                               'closedir'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                                 
   13    43      > RETURN                                                   null

End of function ls

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.16 ms | 1403 KiB | 22 Q