3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new ArrayIterator(get_declared_classes()); $bar = new CachingIterator($foo); foreach($bar as $class) { echo 'Current: ' . $class . '. Next: ' . $bar->getInnerIterator()->current() . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/iB5qa
function name:  (null)
number of ops:  24
compiled vars:  !0 = $foo, !1 = $bar, !2 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'ArrayIterator'
          1        INIT_FCALL                                               'get_declared_classes'
          2        DO_ICALL                                         $4      
          3        SEND_VAR_NO_REF_EX                                       $4
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
    4     6        NEW                                              $7      'CachingIterator'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
    6    10      > FE_RESET_R                                       $10     !1, ->22
         11    > > FE_FETCH_R                                               $10, !2, ->22
    7    12    >   CONCAT                                           ~11     'Current%3A+', !2
         13        CONCAT                                           ~12     ~11, '.+Next%3A+'
         14        INIT_METHOD_CALL                                         !1, 'getInnerIterator'
         15        DO_FCALL                                      0  $13     
         16        INIT_METHOD_CALL                                         $13, 'current'
         17        DO_FCALL                                      0  $14     
         18        CONCAT                                           ~15     ~12, $14
         19        CONCAT                                           ~16     ~15, '%0A'
         20        ECHO                                                     ~16
    6    21      > JMP                                                      ->11
         22    >   FE_FREE                                                  $10
    8    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.67 ms | 1395 KiB | 15 Q