3v4l.org

run code in 500+ PHP versions simultaneously
<?php class a {} $a = new a; $b = '\\a'; var_dump($a instanceof $b); var_dump($a instanceof \a); // C is not a constant, but a class name (see use) const object = '\\a'; var_dump($a instanceof object); use a as c; var_dump($a instanceof c); // compile error : unexpected T_CLASS // var_dump($a instanceof a::class); // compile error : unexpected T_CONSTANT_ENCAPS_STRING // var_dump($a instanceof 'a');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qig0E
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   NEW                                                  $2      'a'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
    7     3        ASSIGN                                                       !1, '%5Ca'
    8     4        INIT_FCALL                                                   'var_dump'
          5        FETCH_CLASS                                       0  $6      !1
          6        INSTANCEOF                                           ~7      !0, $6
          7        SEND_VAL                                                     ~7
          8        DO_ICALL                                                     
    9     9        INIT_FCALL                                                   'var_dump'
         10        INSTANCEOF                                           ~9      !0, 'a'
         11        SEND_VAL                                                     ~9
         12        DO_ICALL                                                     
   12    13        DECLARE_CONST                                                'object', '%5Ca'
   13    14        INIT_FCALL                                                   'var_dump'
         15        INSTANCEOF                                           ~11     !0, 'object'
         16        SEND_VAL                                                     ~11
         17        DO_ICALL                                                     
   15    18        INIT_FCALL                                                   'var_dump'
         19        INSTANCEOF                                           ~13     !0, 'a'
         20        SEND_VAL                                                     ~13
         21        DO_ICALL                                                     
   20    22      > RETURN                                                       1

Class a: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.36 ms | 1485 KiB | 14 Q