3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait mytrait { public function foo() { return get_class($this); } } class myclass { use mytrait; } var_dump((new myclass)->foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MlYjR
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'myclass'
   16     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'myclass'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'foo'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class mytrait:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MlYjR
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~0      
          1        GET_CLASS                                        ~1      ~0
          2      > RETURN                                                   ~1
    7     3*     > RETURN                                                   null

End of function foo

End of class mytrait.

Class myclass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.27 ms | 1394 KiB | 15 Q