3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait t { public static function dump(){ print_r(array( get_called_class(), __CLASS__, __TRAIT__ )); } }; class foo { use t; } class bar extends foo { } t::dump(); foo::dump(); bar::dump();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o88dO
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'foo'
   15     1        DECLARE_CLASS                                            'bar', 'foo'
   19     2        INIT_STATIC_METHOD_CALL                                  't', 'dump'
          3        DO_FCALL                                      0          
   20     4        INIT_STATIC_METHOD_CALL                                  'foo', 'dump'
          5        DO_FCALL                                      0          
   21     6        INIT_STATIC_METHOD_CALL                                  'bar', 'dump'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function dump

End of class t.

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.06 ms | 1395 KiB | 15 Q