3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PDOStmt extends PDOStatement implements IteratorAggregate { public function getIterator() { return new ArrayIterator([1,2,3]); } } foreach(new PDOStmt() as $stmt) { echo $stmt; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/A2ifd
function name:  (null)
number of ops:  9
compiled vars:  !0 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'pdostmt', 'pdostatement'
    9     1        NEW                                              $1      'PDOStmt'
          2        DO_FCALL                                      0          
          3      > FE_RESET_R                                       $3      $1, ->7
          4    > > FE_FETCH_R                                               $3, !0, ->7
   10     5    >   ECHO                                                     !0
    9     6      > JMP                                                      ->4
          7    >   FE_FREE                                                  $3
   11     8      > RETURN                                                   1

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

End of function getiterator

End of class PDOStmt.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.59 ms | 1393 KiB | 13 Q