3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { public function test() { return 'A'; } } trait B { public function test() { return 'B'; } } class C { use A, B { A::test insteadof B; B::test insteadof A; } public function test() { return 'X'; } } $c = new C(); var_dump($c->test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jeYMX
function name:  (null)
number of ops:  10
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'c'
   26     1        NEW                                              $1      'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   27     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'test'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jeYMX
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'A'
    6     1*     > RETURN                                                   null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jeYMX
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'B'
   12     1*     > RETURN                                                   null

End of function test

End of class B.

Class C:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jeYMX
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E > > RETURN                                                   'X'
   23     1*     > RETURN                                                   null

End of function test

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.26 ms | 1010 KiB | 14 Q