3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myData implements IteratorAggregate { public $property1 = "Public property one"; public $property2 = "Public property two"; public $property3 = "Public property three"; public function __construct() { $this->property4 = "last property"; } public function getIterator() { return new ArrayIterator($this); } } $obj = new myData; foreach($obj as $key => $value) { var_dump($key, $value); echo "\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/qMaKn
function name:  (null)
number of ops:  15
compiled vars:  !0 = $obj, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'mydata'
   16     1        NEW                                              $3      'myData'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   18     4      > FE_RESET_R                                       $6      !0, ->13
          5    > > FE_FETCH_R                                       ~7      $6, !1, ->13
          6    >   ASSIGN                                                   !2, ~7
   19     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   20    11        ECHO                                                     '%0A'
   18    12      > JMP                                                      ->5
         13    >   FE_FREE                                                  $6
   22    14      > RETURN                                                   1

Class myData:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMaKn
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                               'property4'
          1        OP_DATA                                                  'last+property'
    9     2      > RETURN                                                   null

End of function __construct

Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMaKn
function name:  getIterator
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $0      'ArrayIterator'
          1        FETCH_THIS                                       $1      
          2        SEND_VAR_EX                                              $1
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $0
   13     5*     > RETURN                                                   null

End of function getiterator

End of class myData.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.17 ms | 1396 KiB | 15 Q