3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestParentClass { public function method() { print_r('Parent method'); print "\n"; } } class TestParentClass1 { public function method() { print_r('Parent method'); print "\n"; } } trait TestTrait { public function method() { print_r('Trait method'); print "\n"; } } class TestChildClass extends TestParentClass1 { use TestTrait { TestTrait::method as methodAlias; TestParentClass1::method as methodAlias11; TestParentClass::method insteadof TestTrait; } } (new TestChildClass)->method(); (new TestChildClass)->methodAlias(); (new TestChildClass)->methodAlias11();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V5ciL
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   DECLARE_CLASS                                            'testchildclass', 'testparentclass1'
   40     1        NEW                                              $0      'TestChildClass'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'method'
          4        DO_FCALL                                      0          
   41     5        NEW                                              $3      'TestChildClass'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $3, 'methodAlias'
          8        DO_FCALL                                      0          
   42     9        NEW                                              $6      'TestChildClass'
         10        DO_FCALL                                      0          
         11        INIT_METHOD_CALL                                         $6, 'methodAlias11'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class TestParentClass:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V5ciL
function name:  method
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'print_r'
          1        SEND_VAL                                                 'Parent+method'
          2        DO_ICALL                                                 
    8     3        ECHO                                                     '%0A'
    9     4      > RETURN                                                   null

End of function method

End of class TestParentClass.

Class TestParentClass1:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V5ciL
function name:  method
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'print_r'
          1        SEND_VAL                                                 'Parent+method'
          2        DO_ICALL                                                 
   17     3        ECHO                                                     '%0A'
   18     4      > RETURN                                                   null

End of function method

End of class TestParentClass1.

Class TestTrait:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V5ciL
function name:  method
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'print_r'
          1        SEND_VAL                                                 'Trait+method'
          2        DO_ICALL                                                 
   26     3        ECHO                                                     '%0A'
   27     4      > RETURN                                                   null

End of function method

End of class TestTrait.

Class TestChildClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.12 ms | 1400 KiB | 15 Q