3v4l.org

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

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

End of function fa

End of class TR.

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

End of function fa

End of class A.

Class B:
Function fa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hbk2e
function name:  fa
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'TR', 'fa'
          1        DO_FCALL                                      0  $0      
          2        ADD                                              ~1      $0, 10
          3      > RETURN                                                   ~1
   20     4*     > RETURN                                                   null

End of function fa

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.07 ms | 1394 KiB | 13 Q