3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 0; if ($handle = opendir('.')) { while (false !== ($entry = readdir($handle))) { $count++; } closedir($handle); } echo $count;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
Branch analysis from position: 17
filename:       /in/IOPX5
function name:  (null)
number of ops:  19
compiled vars:  !0 = $count, !1 = $handle, !2 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        INIT_FCALL                                               'opendir'
          2        SEND_VAL                                                 '.'
          3        DO_ICALL                                         $4      
          4        ASSIGN                                           ~5      !1, $4
          5      > JMPZ                                                     ~5, ->17
    4     6    > > JMP                                                      ->8
    5     7    >   PRE_INC                                                  !0
    4     8    >   INIT_FCALL                                               'readdir'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN                                           ~8      !2, $7
         12        TYPE_CHECK                                  1018          ~8
         13      > JMPNZ                                                    ~9, ->7
    7    14    >   INIT_FCALL                                               'closedir'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   10    17    >   ECHO                                                     !0
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.97 ms | 1395 KiB | 19 Q