3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TrimIterator extends IteratorIterator { public function current() { return trim(parent::current()); } } $innerIterator = new ArrayIterator(array('normal', ' trimmable ')); $trim = new TrimIterator($innerIterator); foreach ($trim as $key => $value) { echo "Key:\n"; var_dump($key); echo "Value:\n"; var_dump($value); echo "---next---"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/Y2CVd
function name:  (null)
number of ops:  23
compiled vars:  !0 = $innerIterator, !1 = $trim, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $4      'ArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   12     4        NEW                                              $7      'TrimIterator'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   14     8      > FE_RESET_R                                       $10     !1, ->21
          9    > > FE_FETCH_R                                       ~11     $10, !2, ->21
         10    >   ASSIGN                                                   !3, ~11
   15    11        ECHO                                                     'Key%3A%0A'
   16    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
   17    15        ECHO                                                     'Value%3A%0A'
   18    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   19    19        ECHO                                                     '---next---'
   14    20      > JMP                                                      ->9
         21    >   FE_FREE                                                  $10
   20    22      > RETURN                                                   1

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

End of function current

End of class TrimIterator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.09 ms | 1388 KiB | 17 Q