3v4l.org

run code in 500+ PHP versions simultaneously
<?php class TestParentClass { public function method() { print_r('Parent method'); print "\n"; } } trait TestTrait { public function method() { print_r('Trait method'); print "\n"; } } class TestChildClass extends TestParentClass { use TestTrait { TestParentClass::method as methodParent; } } (new TestChildClass)->methodParent();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5YQIO
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                                'testchildclass', 'testparentclass'
   28     1        NEW                                                  $0      'TestChildClass'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'methodParent'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

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

End of function method

End of class TestParentClass.

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

End of function method

End of class TestTrait.

Class TestChildClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.46 ms | 3333 KiB | 14 Q