3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'USA' => [ 'Alabama' => [ 'Montgomery', 'Birmingham' ], 'Arizona' => [ 'Phoenix', 'Mesa', 'Gilbert' ] ], 'Germany' => [ 'West Germany' => [ 'Bonn', 'Cologne' ] ] ]; $arrayobject = new ArrayObject($array); $iterator = $arrayobject->getIterator(); while($iterator->valid()) { $c = $iterator->current(); echo $iterator->key() . ' => ' . (is_array($c) ? 'array' : $c) . "\n"; $iterator->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
Branch analysis from position: 9
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
Branch analysis from position: 9
filename:       /in/TvPR7
function name:  (null)
number of ops:  29
compiled vars:  !0 = $array, !1 = $arrayobject, !2 = $iterator, !3 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   28     1        NEW                                              $5      'ArrayObject'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   29     5        INIT_METHOD_CALL                                         !1, 'getIterator'
          6        DO_FCALL                                      0  $8      
          7        ASSIGN                                                   !2, $8
   31     8      > JMP                                                      ->25
   32     9    >   INIT_METHOD_CALL                                         !2, 'current'
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !3, $10
   33    12        INIT_METHOD_CALL                                         !2, 'key'
         13        DO_FCALL                                      0  $12     
         14        CONCAT                                           ~13     $12, '+%3D%3E+'
         15        TYPE_CHECK                                  128          !3
         16      > JMPZ                                                     ~14, ->19
         17    >   QM_ASSIGN                                        ~15     'array'
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~15     !3
         20    >   CONCAT                                           ~16     ~13, ~15
         21        CONCAT                                           ~17     ~16, '%0A'
         22        ECHO                                                     ~17
   35    23        INIT_METHOD_CALL                                         !2, 'next'
         24        DO_FCALL                                      0          
   31    25    >   INIT_METHOD_CALL                                         !2, 'valid'
         26        DO_FCALL                                      0  $19     
         27      > JMPNZ                                                    $19, ->9
   36    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.09 ms | 1395 KiB | 13 Q