3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class It extends ArrayIterator { public function current() { printf("current\n"); return parent::current(); } } $i = new It(array(1, 2, 3, 4)); foreach($i as $k => $v) { printf("value: %d\n", $v); }
based on 9PRms
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
Jump found. Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
Jump found. Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
Jump found. Position 1 = -2
Branch analysis from position: 14
filename:       /in/BWLvv
function name:  (null)
number of ops:  16
compiled vars:  !0 = $i, !1 = $v, !2 = $k
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
         1        NOP                                                      
   9     2        NEW                                              $5      :-4
         3        SEND_VAL_EX                                              <array>
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $5
  11     6      > FE_RESET_R                                       $8      !0, ->14
         7    > > FE_FETCH_R                                               $8, !1, ->14
         8    >   ASSIGN                                                   !2, ~9
  12     9        INIT_FCALL                                               'printf'
        10        SEND_VAL                                                 'value%3A+%25d%0A'
        11        SEND_VAR                                                 !1
        12        DO_ICALL                                                 
        13      > JMP                                                      ->7
        14    >   FE_FREE                                                  $8
        15      > RETURN                                                   1

Class It:
Function current:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/BWLvv
function name:  current
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   INIT_FCALL                                               'printf'
         1        SEND_VAL                                                 'current%0A'
         2        DO_ICALL                                                 
   5     3        FETCH_CLASS                                 514  :1      
         4        INIT_STATIC_METHOD_CALL                                  $1, 'current'
         5        DO_FCALL                                      0  $2      
         6      > RETURN                                                   $2
   6     7*     > RETURN                                                   null

End of function current

End of class It.

Generated using Vulcan Logic Dumper, using php 7.3.0