3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { } class B extends A { } $b = new B(); if ($b instanceof B) { echo 1; } if ($b instanceof A) { echo 2; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/HWFSX
function name:  (null)
number of ops:  10
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INSTANCEOF                                               !0, 'B'
          4      > JMPZ                                                     ~4, ->6
   16     5    >   ECHO                                                     1
   18     6    >   INSTANCEOF                                               !0, 'A'
          7      > JMPZ                                                     ~5, ->9
   19     8    >   ECHO                                                     2
   20     9    > > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.84 ms | 1393 KiB | 13 Q