3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($files = scandir('.'); $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 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 20
Branch analysis from position: 18
filename:       /in/dNShR
function name:  (null)
number of ops:  23
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        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
          4      > JMP                                                      ->20
    3     5    >   INIT_FCALL                                               'array_pop'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    4     9        INIT_FCALL                                               'is_file'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $6      
         12      > JMPZ_EX                                          ~7      $6, ->18
         13    >   INIT_FCALL                                               'is_dir'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $8      
         16        BOOL_NOT                                         ~9      $8
         17        BOOL                                             ~7      ~9
         18    > > JMPZ                                                     ~7, ->20
    5    19    > > JMP                                                      ->21
    2    20    > > JMPNZ                                                    !0, ->5
    8    21    >   ECHO                                                     !1
   10    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.11 ms | 1395 KiB | 21 Q