3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DebugRAI extends RecursiveArrayIterator { public function rewind() { echo __METHOD__, "\n"; return parent::rewind(); } public function current() { echo __METHOD__, "\n"; return parent::current(); } public function key() { echo __METHOD__, "\n"; return parent::key(); } public function valid() { echo __METHOD__, "\n"; return parent::valid(); } public function next() { echo __METHOD__, "\n"; return parent::next(); } } $array = array("A", "B", "C"); $iterator = new RecursiveIteratorIterator(new DebugRAI($array)); while ($iterator->valid()) { echo $iterator->current(), "\n"; $iterator->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 9
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/DmAHB
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $iterator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   12     1        NEW                                              $3      'RecursiveIteratorIterator'
          2        NEW                                              $4      'DebugRAI'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $4
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $3
   13     8      > JMP                                                      ->15
   14     9    >   INIT_METHOD_CALL                                         !1, 'current'
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12        ECHO                                                     '%0A'
   15    13        INIT_METHOD_CALL                                         !1, 'next'
         14        DO_FCALL                                      0          
   13    15    >   INIT_METHOD_CALL                                         !1, 'valid'
         16        DO_FCALL                                      0  $10     
         17      > JMPNZ                                                    $10, ->9
   16    18    > > RETURN                                                   1

Class DebugRAI:
Function rewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmAHB
function name:  rewind
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'DebugRAI%3A%3Arewind'
          1        ECHO                                                     '%0A'
          2        INIT_STATIC_METHOD_CALL                                  'rewind'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
          5*     > RETURN                                                   null

End of function rewind

Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmAHB
function name:  current
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'DebugRAI%3A%3Acurrent'
          1        ECHO                                                     '%0A'
          2        INIT_STATIC_METHOD_CALL                                  'current'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
          5*     > RETURN                                                   null

End of function current

Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmAHB
function name:  key
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'DebugRAI%3A%3Akey'
          1        ECHO                                                     '%0A'
          2        INIT_STATIC_METHOD_CALL                                  'key'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
          5*     > RETURN                                                   null

End of function key

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmAHB
function name:  valid
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'DebugRAI%3A%3Avalid'
          1        ECHO                                                     '%0A'
          2        INIT_STATIC_METHOD_CALL                                  'valid'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
          5*     > RETURN                                                   null

End of function valid

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmAHB
function name:  next
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'DebugRAI%3A%3Anext'
          1        ECHO                                                     '%0A'
          2        INIT_STATIC_METHOD_CALL                                  'next'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
          5*     > RETURN                                                   null

End of function next

End of class DebugRAI.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.09 ms | 1403 KiB | 13 Q