3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyTrait { public function __get($name) { echo get_class($this); } } class Foo { use MyTrait; } $foo = new Foo(); echo $foo->unknown;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2YCWM
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'foo'
   15     1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   16     4        FETCH_OBJ_R                                      ~4      !0, 'unknown'
          5        ECHO                                                     ~4
          6      > RETURN                                                   1

Class MyTrait:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2YCWM
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        FETCH_THIS                                       ~1      
          2        GET_CLASS                                        ~2      ~1
          3        ECHO                                                     ~2
    8     4      > RETURN                                                   null

End of function __get

End of class MyTrait.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.83 ms | 1393 KiB | 13 Q