3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($files = scandir('.', 1); $files; ) { $file = array_pop($files); if (is_file($file) && !is_dir($file)) { break; } } echo $file; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 6
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 21
Branch analysis from position: 19
filename:       /in/6uo6E
function name:  (null)
number of ops:  24
compiled vars:  !0 = $files, !1 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'scandir'
          1        SEND_VAL                                                 '.'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
          5      > JMP                                                      ->21
    3     6    >   INIT_FCALL                                               'array_pop'
          7        SEND_REF                                                 !0
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
    4    10        INIT_FCALL                                               'is_file'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13      > JMPZ_EX                                          ~7      $6, ->19
         14    >   INIT_FCALL                                               'is_dir'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $8      
         17        BOOL_NOT                                         ~9      $8
         18        BOOL                                             ~7      ~9
         19    > > JMPZ                                                     ~7, ->21
    5    20    > > JMP                                                      ->22
    2    21    > > JMPNZ                                                    !0, ->6
    8    22    >   ECHO                                                     !1
   10    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.6 ms | 1387 KiB | 21 Q