3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait X{ function test(A $a){} function tryA(A $a){ $this->test($a); } } trait Y{ function test(B $b){} function tryB(B $b){ $this->test($b); } } class Test{ use X, Y{ X::test insteadof Y; } } class A{} class B{} $x = new Test; $x->tryA(new A); $x->tryB(new B);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R8ZKl
function name:  (null)
number of ops:  15
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'test'
   28     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   29     4        INIT_METHOD_CALL                                         !0, 'tryA'
          5        NEW                                              $4      'A'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
   30     9        INIT_METHOD_CALL                                         !0, 'tryB'
         10        NEW                                              $7      'B'
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $7
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function test

Function trya:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R8ZKl
function name:  tryA
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_METHOD_CALL                                         'test'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    8     4      > RETURN                                                   null

End of function trya

End of class X.

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

End of function test

Function tryb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R8ZKl
function name:  tryB
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_METHOD_CALL                                         'test'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   16     4      > RETURN                                                   null

End of function tryb

End of class Y.

Class Test: [no user functions]
Class A: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.38 ms | 1399 KiB | 13 Q