3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooIterator extends ArrayIterator { public function current() { return 'herpderp'; } } $a = [1,2,3]; next($a); var_dump(current($a)); rewind($a); var_dump(current($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Koi2
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'next'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
   11     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'current'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
   12    10        INIT_FCALL                                               'rewind'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   13    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'current'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $6      
         17        SEND_VAR                                                 $6
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class FooIterator:
Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Koi2
function name:  current
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'herpderp'
    6     1*     > RETURN                                                   null

End of function current

End of class FooIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.33 ms | 1395 KiB | 21 Q