3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = new SplFileObject('/a.txt'); $iterator = new DirectoryIterator('/'); while($iterator->valid()) { $file = $iterator->current(); echo $iterator->key() . " => " . $file->getFilename() . "\n"; $iterator->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
Branch analysis from position: 9
filename:       /in/WaQlA
function name:  (null)
number of ops:  26
compiled vars:  !0 = $f, !1 = $iterator, !2 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'SplFileObject'
          1        SEND_VAL_EX                                              '%2Fa.txt'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        NEW                                              $6      'DirectoryIterator'
          5        SEND_VAL_EX                                              '%2F'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    4     8      > JMP                                                      ->22
    5     9    >   INIT_METHOD_CALL                                         !1, 'current'
         10        DO_FCALL                                      0  $9      
         11        ASSIGN                                                   !2, $9
    6    12        INIT_METHOD_CALL                                         !1, 'key'
         13        DO_FCALL                                      0  $11     
         14        CONCAT                                           ~12     $11, '+%3D%3E+'
         15        INIT_METHOD_CALL                                         !2, 'getFilename'
         16        DO_FCALL                                      0  $13     
         17        CONCAT                                           ~14     ~12, $13
         18        CONCAT                                           ~15     ~14, '%0A'
         19        ECHO                                                     ~15
    7    20        INIT_METHOD_CALL                                         !1, 'next'
         21        DO_FCALL                                      0          
    4    22    >   INIT_METHOD_CALL                                         !1, 'valid'
         23        DO_FCALL                                      0  $17     
         24      > JMPNZ                                                    $17, ->9
    8    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.28 ms | 1385 KiB | 13 Q