3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function bb() { echo 'parent-'; } } trait B { function bb() { echo 'trait-'; //parent::bb(); } } class C extends A { use B; function bb() { echo 'class-'; B::bb(); parent::bb(); } } $o=new C; $o->bb();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oCKG9
function name:  (null)
number of ops:  7
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   DECLARE_CLASS                                            'c', 'a'
   25     1        NEW                                              $1      'C'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   26     4        INIT_METHOD_CALL                                         !0, 'bb'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function bb

End of class A.

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

End of function bb

End of class B.

Class C:
Function bb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oCKG9
function name:  bb
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'class-'
   20     1        INIT_STATIC_METHOD_CALL                                  'B', 'bb'
          2        DO_FCALL                                      0          
   21     3        INIT_STATIC_METHOD_CALL                                  'bb'
          4        DO_FCALL                                      0          
   22     5      > RETURN                                                   null

End of function bb

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.79 ms | 1394 KiB | 13 Q