3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1,2,3,4,5); $it = new CachingIterator(new ArrayIterator($arr)); var_dump($it->current()); echo PHP_EOL; $it->next(); var_dump($it->current()); echo PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/406X5
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        NEW                                              $3      'CachingIterator'
          2        NEW                                              $4      'ArrayIterator'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $4
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $3
    5     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !1, 'current'
         10        DO_FCALL                                      0  $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                                 
         13        ECHO                                                     '%0A'
    6    14        INIT_METHOD_CALL                                         !1, 'next'
         15        DO_FCALL                                      0          
    7    16        INIT_FCALL                                               'var_dump'
         17        INIT_METHOD_CALL                                         !1, 'current'
         18        DO_FCALL                                      0  $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                                 
         21        ECHO                                                     '%0A'
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1395 KiB | 15 Q