3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NullKeyIterator extends \ArrayIterator { public function key() { return 3.22; } } $iterator = new NullKeyIterator(range(1,10)); foreach($iterator as $key => $value) { var_dump($key, $value); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/nAoW3
function name:  (null)
number of ops:  18
compiled vars:  !0 = $iterator, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'NullKeyIterator'
          1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 10
          4        DO_ICALL                                         $4      
          5        SEND_VAR_NO_REF_EX                                       $4
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $3
   11     8      > FE_RESET_R                                       $7      !0, ->16
          9    > > FE_FETCH_R                                       ~8      $7, !1, ->16
         10    >   ASSIGN                                                   !2, ~8
   12    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   11    15      > JMP                                                      ->9
         16    >   FE_FREE                                                  $7
   13    17      > RETURN                                                   1

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

End of function key

End of class NullKeyIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.85 ms | 1395 KiB | 17 Q