3v4l.org

run code in 300+ PHP versions simultaneously
<?php class It extends ArrayIterator { public function __call($method, $args) { printf("%s\n", $method); return $this->$method(); } } $i = new It(array(1, 2, 3, 4)); foreach($i as $k => $v) { printf("value: %d\n", $v); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/9PRms
function name:  (null)
number of ops:  14
compiled vars:  !0 = $i, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $3      'It'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   11     4      > FE_RESET_R                                       $6      !0, ->12
          5    > > FE_FETCH_R                                       ~7      $6, !1, ->12
          6    >   ASSIGN                                                   !2, ~7
   12     7        INIT_FCALL                                               'printf'
          8        SEND_VAL                                                 'value%3A+%25d%0A'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   11    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $6
   13    13      > RETURN                                                   1

Class It:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9PRms
function name:  __call
number of ops:  10
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'printf'
          3        SEND_VAL                                                 '%25s%0A'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    5     6        INIT_METHOD_CALL                                         !0
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
    6     9*     > RETURN                                                   null

End of function __call

End of class It.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.07 ms | 1396 KiB | 15 Q