3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $x = array( //"prop1" => "foo", //"prop2" => "bar", //"prop3" => "boo", ); $xObj = new ArrayObject($x); $iterator = $xObj->getIterator(); if (! $iterator->valid()) { echo "no elem".PHP_EOL; return; } echo $iterator->key().': '.$iterator->current().PHP_EOL; $iterator->next(); while($iterator->valid()) { echo $iterator->key().': '.$iterator->current().PHP_EOL; $iterator->next(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 28
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 28
Branch analysis from position: 41
Branch analysis from position: 28
filename:       /in/YcVD2
function name:  (null)
number of ops:  42
compiled vars:  !0 = $x, !1 = $xObj, !2 = $iterator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, <array>
   11     4        NEW                                              $5      'ArrayObject'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   12     8        INIT_METHOD_CALL                                         !1, 'getIterator'
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !2, $8
   14    11        INIT_METHOD_CALL                                         !2, 'valid'
         12        DO_FCALL                                      0  $10     
         13        BOOL_NOT                                         ~11     $10
         14      > JMPZ                                                     ~11, ->17
   15    15    >   ECHO                                                     'no+elem%0A'
   17    16      > RETURN                                                   null
   19    17    >   INIT_METHOD_CALL                                         !2, 'key'
         18        DO_FCALL                                      0  $12     
         19        CONCAT                                           ~13     $12, '%3A+'
         20        INIT_METHOD_CALL                                         !2, 'current'
         21        DO_FCALL                                      0  $14     
         22        CONCAT                                           ~15     ~13, $14
         23        CONCAT                                           ~16     ~15, '%0A'
         24        ECHO                                                     ~16
   21    25        INIT_METHOD_CALL                                         !2, 'next'
         26        DO_FCALL                                      0          
   22    27      > JMP                                                      ->38
   23    28    >   INIT_METHOD_CALL                                         !2, 'key'
         29        DO_FCALL                                      0  $18     
         30        CONCAT                                           ~19     $18, '%3A+'
         31        INIT_METHOD_CALL                                         !2, 'current'
         32        DO_FCALL                                      0  $20     
         33        CONCAT                                           ~21     ~19, $20
         34        CONCAT                                           ~22     ~21, '%0A'
         35        ECHO                                                     ~22
   24    36        INIT_METHOD_CALL                                         !2, 'next'
         37        DO_FCALL                                      0          
   22    38    >   INIT_METHOD_CALL                                         !2, 'valid'
         39        DO_FCALL                                      0  $24     
         40      > JMPNZ                                                    $24, ->28
   25    41    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.05 ms | 1005 KiB | 14 Q