3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { } class B extends A { } function test(A $a) { echo 3; } $b = new B(); test($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 = 8, Position 2 = 9
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 9
filename:       /in/EPABN
function name:  (null)
number of ops:  13
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'test'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
   20     6        INSTANCEOF                                               !0, 'B'
          7      > JMPZ                                                     ~5, ->9
   21     8    >   ECHO                                                     1
   23     9    >   INSTANCEOF                                               !0, 'A'
         10      > JMPZ                                                     ~6, ->12
   24    11    >   ECHO                                                     2
   25    12    > > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EPABN
function name:  test
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ECHO                                                     3
   15     2      > RETURN                                                   null

End of function test

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.76 ms | 1397 KiB | 14 Q