3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface MyInterface { public function printHello(); } class MyClass implements MyInterface { public function printHello() { echo "Hello"; } } $o=new MyClass(); if ($o instanceof MyInterface) echo "is"; else echo "is not";
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 = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0CArP
function name:  (null)
number of ops:  10
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'myclass'
   12     1        NEW                                              $1      'MyClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        INSTANCEOF                                               !0, 'MyInterface'
          5      > JMPZ                                                     ~4, ->8
          6    >   ECHO                                                     'is'
          7      > JMP                                                      ->9
   14     8    >   ECHO                                                     'is+not'
          9    > > RETURN                                                   1

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

End of function printhello

End of class MyInterface.

Class MyClass:
Function printhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0CArP
function name:  printHello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'Hello'
    9     1      > RETURN                                                   null

End of function printhello

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.08 ms | 1394 KiB | 13 Q