3v4l.org

run code in 500+ PHP versions simultaneously
<?php Interface A { public function test(); } class B implements A { public function test() { return $something; } } $someBclass = new B(); if ($someBclass instanceOf A) echo 'instanceOf', PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/3XDOo
function name:  (null)
number of ops:  9
compiled vars:  !0 = $someBclass
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                                'b'
   14     1        NEW                                                  $1      'B'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   15     4        INSTANCEOF                                                   !0, 'A'
          5      > JMPZ                                                         ~4, ->8
   16     6    >   ECHO                                                         'instanceOf'
          7        ECHO                                                         '%0A'
          8    > > RETURN                                                       1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3XDOo
function name:  test
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                       null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3XDOo
function name:  test
number of ops:  2
compiled vars:  !0 = $something
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                       !0
   10     1*     > RETURN                                                       null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.82 ms | 2759 KiB | 13 Q