3v4l.org

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

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

End of function __construct

End of class bar.

Class foo: [no user functions]
Class baz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
253.56 ms | 1015 KiB | 14 Q