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; } } $talker = new Talker(); echo $talker->smallTalk()."<br/>"; echo $talker->bigTalk()."<br/>"; $al = new Aliased_Talker(); echo $al->talk(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1m4I
function name:  (null)
number of ops:  20
compiled vars:  !0 = $talker, !1 = $al
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   DECLARE_CLASS                                            'talker'
   28     1        DECLARE_CLASS                                            'aliased_talker'
   36     2        NEW                                              $2      'Talker'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   38     5        INIT_METHOD_CALL                                         !0, 'smallTalk'
          6        DO_FCALL                                      0  $5      
          7        CONCAT                                           ~6      $5, '%3Cbr%2F%3E'
          8        ECHO                                                     ~6
   39     9        INIT_METHOD_CALL                                         !0, 'bigTalk'
         10        DO_FCALL                                      0  $7      
         11        CONCAT                                           ~8      $7, '%3Cbr%2F%3E'
         12        ECHO                                                     ~8
   41    13        NEW                                              $9      'Aliased_Talker'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $9
   42    16        INIT_METHOD_CALL                                         !1, 'talk'
         17        DO_FCALL                                      0  $12     
         18        ECHO                                                     $12
   45    19      > RETURN                                                   1

Class A:
Function smalltalk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1m4I
function name:  smallTalk
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 smalltalk

Function bigtalk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1m4I
function name:  bigTalk
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'A'
    9     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/M1m4I
function name:  smallTalk
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'b'
   15     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/M1m4I
function name:  bigTalk
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ECHO                                                     'B'
   18     1      > RETURN                                                   null

End of function bigtalk

End of class B.

Class Talker: [no user functions]
Class Aliased_Talker: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.75 ms | 1403 KiB | 13 Q