3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo extends Traversable { } class Bar implements IteratorAggregate, Foo { public function getIterator() { return new ArrayIterator(array(1, 2, 3)); } } $b = new Bar; var_dump($b instanceof Foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DkIvQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
    6     1        DECLARE_CLASS                                            'bar'
   12     2        NEW                                              $1      'Bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   14     5        INIT_FCALL                                               'var_dump'
          6        INSTANCEOF                                       ~4      !0, 'Foo'
          7        SEND_VAL                                                 ~4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function getiterator

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.97 ms | 1395 KiB | 15 Q