3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { public function smallTalk() { echo 'a'; } public function bigTalk() { echo 'A'; } } trait B { public function smallTalk() { echo 'b'; } public function bigTalk() { echo 'B'; } } class Talker { use A, B { B::smallTalk insteadof A; A::bigTalk insteadof B; } } class Aliased_Talker { use A, B { B::smallTalk insteadof A; A::bigTalk insteadof B; B::bigTalk as talk; } function hi() { echo talk(); } } $alias = new Aliased_Talker(); $alias->hi();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A2nO7
function name:  (null)
number of ops:  8
compiled vars:  !0 = $alias
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'talker'
   27     1        DECLARE_CLASS                                            'aliased_talker'
   39     2        NEW                                              $1      'Aliased_Talker'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   40     5        INIT_METHOD_CALL                                         !0, 'hi'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function smalltalk

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

End of function bigtalk

End of class A.

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

End of function smalltalk

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

End of function bigtalk

End of class B.

Class Talker: [no user functions]
Class Aliased_Talker:
Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A2nO7
function name:  hi
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_FCALL_BY_NAME                                       'talk'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   36     3      > RETURN                                                   null

End of function hi

End of class Aliased_Talker.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.09 ms | 1399 KiB | 13 Q