3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B {} $a = new A; switch (true) { case $a instanceof A: echo "A\n"; break; case $a instanceof B: echo "B\n"; break; default: echo "NO\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
filename:       /in/SS95r
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INSTANCEOF                                               !0, 'A'
          4      > JMPNZ                                                    ~5, ->8
   12     5    >   INSTANCEOF                                               !0, 'B'
          6      > JMPNZ                                                    ~6, ->10
          7    > > JMP                                                      ->12
   10     8    >   ECHO                                                     'A%0A'
   11     9      > JMP                                                      ->13
   13    10    >   ECHO                                                     'B%0A'
   14    11      > JMP                                                      ->13
   16    12    >   ECHO                                                     'NO%0A'
   17    13    > > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.73 ms | 1394 KiB | 13 Q