3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array(1 => 'one', 2 => 'two', 3 => 'three'); $obj = new ArrayObject($numbers); $iterator =new ArrayIterator($obj); echo "Before insertion:\n"; foreach ($iterator as $key=>$val) echo " ".$key."=>".$val."\n"; $obj->append('four'); // $numbers[] = 'four'; echo "\nAfter appending a new value:\n"; foreach ($iterator as $key=>$val) echo " ".$key."=>".$val."\n"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 19
filename:       /in/r1r3g
function name:  (null)
number of ops:  35
compiled vars:  !0 = $numbers, !1 = $obj, !2 = $iterator, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        NEW                                              $6      'ArrayObject'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    6     5        NEW                                              $9      'ArrayIterator'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
    8     9        ECHO                                                     'Before+insertion%3A%0A'
    9    10      > FE_RESET_R                                       $12     !2, ->19
         11    > > FE_FETCH_R                                       ~13     $12, !3, ->19
         12    >   ASSIGN                                                   !4, ~13
         13        CONCAT                                           ~15     '++++', !4
         14        CONCAT                                           ~16     ~15, '%3D%3E'
         15        CONCAT                                           ~17     ~16, !3
         16        CONCAT                                           ~18     ~17, '%0A'
         17        ECHO                                                     ~18
         18      > JMP                                                      ->11
         19    >   FE_FREE                                                  $12
   11    20        INIT_METHOD_CALL                                         !1, 'append'
         21        SEND_VAL_EX                                              'four'
         22        DO_FCALL                                      0          
   13    23        ECHO                                                     '%0AAfter+appending+a+new+value%3A%0A'
   14    24      > FE_RESET_R                                       $20     !2, ->33
         25    > > FE_FETCH_R                                       ~21     $20, !3, ->33
         26    >   ASSIGN                                                   !4, ~21
         27        CONCAT                                           ~23     '++++', !4
         28        CONCAT                                           ~24     ~23, '%3D%3E'
         29        CONCAT                                           ~25     ~24, !3
         30        CONCAT                                           ~26     ~25, '%0A'
         31        ECHO                                                     ~26
         32      > JMP                                                      ->25
         33    >   FE_FREE                                                  $20
   16    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.98 ms | 1395 KiB | 13 Q