3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait TraitA { public function methodA() { var_dump(__METHOD__); } public function methodB() { var_dump(__METHOD__); } } class ClassA { use TraitA { methodA as private traitMethodA; methodB as traitMethodB; } public function methodA() { var_dump(__METHOD__); $this->traitMethodA(); } } $o = new ClassA(); $o->methodA(); $o->traitMethodB(); $o->methodB();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/848g8
function name:  (null)
number of ops:  11
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'classa'
   24     1        NEW                                              $1      'ClassA'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        INIT_METHOD_CALL                                         !0, 'methodA'
          5        DO_FCALL                                      0          
   26     6        INIT_METHOD_CALL                                         !0, 'traitMethodB'
          7        DO_FCALL                                      0          
   27     8        INIT_METHOD_CALL                                         !0, 'methodB'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class TraitA:
Function methoda:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/848g8
function name:  methodA
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'TraitA%3A%3AmethodA'
          2        DO_ICALL                                                 
    6     3      > RETURN                                                   null

End of function methoda

Function methodb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/848g8
function name:  methodB
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'TraitA%3A%3AmethodB'
          2        DO_ICALL                                                 
    9     3      > RETURN                                                   null

End of function methodb

End of class TraitA.

Class ClassA:
Function methoda:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/848g8
function name:  methodA
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'ClassA%3A%3AmethodA'
          2        DO_ICALL                                                 
   20     3        INIT_METHOD_CALL                                         'traitMethodA'
          4        DO_FCALL                                      0          
   21     5      > RETURN                                                   null

End of function methoda

End of class ClassA.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.22 ms | 1396 KiB | 15 Q