3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = new SplFileObject('/a.txt', "w+"); $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 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 10
Branch analysis from position: 26
Branch analysis from position: 10
filename:       /in/Z2rgG
function name:  (null)
number of ops:  27
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        SEND_VAL_EX                                              'w%2B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
    3     5        NEW                                              $6      'DirectoryIterator'
          6        SEND_VAL_EX                                              '%2F'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
    4     9      > JMP                                                      ->23
    5    10    >   INIT_METHOD_CALL                                         !1, 'current'
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !2, $9
    6    13        INIT_METHOD_CALL                                         !1, 'key'
         14        DO_FCALL                                      0  $11     
         15        CONCAT                                           ~12     $11, '+%3D%3E+'
         16        INIT_METHOD_CALL                                         !2, 'getFilename'
         17        DO_FCALL                                      0  $13     
         18        CONCAT                                           ~14     ~12, $13
         19        CONCAT                                           ~15     ~14, '%0A'
         20        ECHO                                                     ~15
    7    21        INIT_METHOD_CALL                                         !1, 'next'
         22        DO_FCALL                                      0          
    4    23    >   INIT_METHOD_CALL                                         !1, 'valid'
         24        DO_FCALL                                      0  $17     
         25      > JMPNZ                                                    $17, ->10
    8    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.69 ms | 1394 KiB | 13 Q