3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_empty_dir($dir) { if (($files = @scandir($dir)) && count($files) <= 2) { return true; } return false; } echo is_empty_dir("/");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j0o0k
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'is_empty_dir'
          1        SEND_VAL                                                 '%2F'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function is_empty_dir:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/j0o0k
function name:  is_empty_dir
number of ops:  15
compiled vars:  !0 = $dir, !1 = $files
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        BEGIN_SILENCE                                    ~2      
          2        INIT_FCALL                                               'scandir'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        END_SILENCE                                              ~2
          6        ASSIGN                                           ~4      !1, $3
          7      > JMPZ_EX                                          ~4      ~4, ->11
          8    >   COUNT                                            ~5      !1
          9        IS_SMALLER_OR_EQUAL                              ~6      ~5, 2
         10        BOOL                                             ~4      ~6
         11    > > JMPZ                                                     ~4, ->13
    6    12    > > RETURN                                                   <true>
    8    13    > > RETURN                                                   <false>
    9    14*     > RETURN                                                   null

End of function is_empty_dir

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.71 ms | 1402 KiB | 16 Q