3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { public function x(): void { echo 'A'; } } trait B { public function x(): void { echo 'B'; } } class Foo { use A { x as private ax; } use B { x as private bx; } public function x(): void { $this->ax(); $this->bx(); } } (new Foo())->x();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vE0YH
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'foo'
   29     1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'x'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function x

End of class A.

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

End of function x

End of class B.

Class Foo:
Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vE0YH
function name:  x
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_METHOD_CALL                                         'ax'
          1        DO_FCALL                                      0          
   25     2        INIT_METHOD_CALL                                         'bx'
          3        DO_FCALL                                      0          
   26     4      > RETURN                                                   null

End of function x

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147 ms | 999 KiB | 13 Q