3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { function bar() { var_dump(get_defined_vars(), get_class(), get_class(null), get_class(self), get_class($this)); } } class B { use A; } $f = new B; $f->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YGGAZ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'b'
          1        NEW                                              $1      'B'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4        INIT_METHOD_CALL                                         !0, 'bar'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class A:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YGGAZ
function name:  bar
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'get_defined_vars'
          2        DO_ICALL                                         $0      
          3        SEND_VAR                                                 $0
          4        GET_CLASS                                        ~1      
          5        SEND_VAL                                                 ~1
          6        GET_CLASS                                        ~2      null
          7        SEND_VAL                                                 ~2
          8        FETCH_CONSTANT                                   ~3      'self'
          9        GET_CLASS                                        ~4      ~3
         10        SEND_VAL                                                 ~4
         11        FETCH_THIS                                       ~5      
         12        GET_CLASS                                        ~6      ~5
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                                 
         15      > RETURN                                                   null

End of function bar

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.6 ms | 1395 KiB | 17 Q