3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); ini_set('log_errors','Off'); ini_set('display_errors', 'On'); trait collision { public function collisionMethod() { echo "collision\n"; } public function unusedMethod() { echo "unused\n"; } } trait A { use collision; public function sayA() { $this->collisionMethod(); echo "Aです\n"; } } trait B { use collision; public function sayB() { $this->collisionMethod(); echo "Bです\n"; } } class User { use A; use B; } $user = new User; $user->sayA(); $user->sayB();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4kqGt
function name:  (null)
number of ops:  22
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'log_errors'
          5        SEND_VAL                                                 'Off'
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'ini_set'
          8        SEND_VAL                                                 'display_errors'
          9        SEND_VAL                                                 'On'
         10        DO_ICALL                                                 
   20    11        DECLARE_CLASS                                            'a'
   30    12        DECLARE_CLASS                                            'b'
   40    13        DECLARE_CLASS                                            'user'
   45    14        NEW                                              $4      'User'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !0, $4
   46    17        INIT_METHOD_CALL                                         !0, 'sayA'
         18        DO_FCALL                                      0          
   47    19        INIT_METHOD_CALL                                         !0, 'sayB'
         20        DO_FCALL                                      0          
         21      > RETURN                                                   1

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

End of function collisionmethod

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

End of function unusedmethod

End of class collision.

Class A:
Function saya:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4kqGt
function name:  sayA
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_METHOD_CALL                                         'collisionMethod'
          1        DO_FCALL                                      0          
   26     2        ECHO                                                     'A%E3%81%A7%E3%81%99%0A'
   27     3      > RETURN                                                   null

End of function saya

End of class A.

Class B:
Function sayb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4kqGt
function name:  sayB
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_METHOD_CALL                                         'collisionMethod'
          1        DO_FCALL                                      0          
   36     2        ECHO                                                     'B%E3%81%A7%E3%81%99%0A'
   37     3      > RETURN                                                   null

End of function sayb

End of class B.

Class User: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.29 ms | 1400 KiB | 17 Q