3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} interface B {} trait C {} class D extends A implements B { use C; public function check() { var_dump($this instanceof A); // Class var_dump($this instanceof B); // Interface var_dump($this instanceof C); // Trait var_dump($this instanceof D); // Self } } (new D)->check(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UbIKk
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'd', 'a'
   18     1        NEW                                              $0      'D'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'check'
          4        DO_FCALL                                      0          
   20     5      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class C: [no user functions]
Class D:
Function check:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UbIKk
function name:  check
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        INSTANCEOF                                       ~1      ~0, 'A'
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
   12     5        INIT_FCALL                                               'var_dump'
          6        FETCH_THIS                                       ~3      
          7        INSTANCEOF                                       ~4      ~3, 'B'
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
   13    10        INIT_FCALL                                               'var_dump'
         11        FETCH_THIS                                       ~6      
         12        INSTANCEOF                                       ~7      ~6, 'C'
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                                 
   14    15        INIT_FCALL                                               'var_dump'
         16        FETCH_THIS                                       ~9      
         17        INSTANCEOF                                       ~10     ~9, 'D'
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                                 
   15    20      > RETURN                                                   null

End of function check

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
250.93 ms | 1003 KiB | 14 Q