3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ListA implements IteratorAggregate, ArrayAccess { public function getIterator() { return new ArrayIterator(['abc','def','dfgh']); } } $a = new ListA; echo $a[2];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pPZ3Z
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'lista'
   12     1        NEW                                              $1      'ListA'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        FETCH_DIM_R                                      ~4      !0, 2
          5        ECHO                                                     ~4
          6      > RETURN                                                   1

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

End of function getiterator

End of class ListA.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.95 ms | 1393 KiB | 13 Q