3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { const B = 'A::B is a constant'.PHP_EOL; } class C { const B = 'C::B is a constant'.PHP_EOL; } const C = new A; echo C::B; // C is the class echo (C)::B; // C is the constant // C is a class here var_dump(new C instanceof C); // (C) is the constant, var_dump(new C instanceof (C)); // instanceof works with objects too var_dump(new C instanceof (new C)); // but this is invalid syntax //var_dump(new C instanceof new C); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XsH0k
function name:  (null)
number of ops:  30
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CONST                                                'C', <const ast>
    9     1        ECHO                                                         'C%3A%3AB+is+a+constant%0A'
   10     2        FETCH_CONSTANT                                       ~0      'C'
          3        FETCH_CLASS                                       0  $1      ~0
          4        FETCH_CLASS_CONSTANT                                 ~2      $1, 'B'
          5        ECHO                                                         ~2
   13     6        INIT_FCALL                                                   'var_dump'
          7        NEW                                                  $3      'C'
          8        DO_FCALL                                          0          
          9        INSTANCEOF                                           ~5      $3, 'C'
         10        SEND_VAL                                                     ~5
         11        DO_ICALL                                                     
   15    12        INIT_FCALL                                                   'var_dump'
         13        NEW                                                  $7      'C'
         14        DO_FCALL                                          0          
         15        FETCH_CONSTANT                                       ~9      'C'
         16        FETCH_CLASS                                       0  $10     ~9
         17        INSTANCEOF                                           ~11     $7, $10
         18        SEND_VAL                                                     ~11
         19        DO_ICALL                                                     
   18    20        INIT_FCALL                                                   'var_dump'
         21        NEW                                                  $13     'C'
         22        DO_FCALL                                          0          
         23        NEW                                                  $15     'C'
         24        DO_FCALL                                          0          
         25        FETCH_CLASS                                       0  $17     $15
         26        INSTANCEOF                                           ~18     $13, $17
         27        SEND_VAL                                                     ~18
         28        DO_ICALL                                                     
   23    29      > RETURN                                                       1

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.53 ms | 1481 KiB | 14 Q