3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Helper { protected function foo() { echo "foo"; } } trait MyTrait { use Helper; } abstract class Controller { use Helper; } class MyController extends Controller { use MyTrait; public function myFunction() { foo(); } } (new MyController)->myFunction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f9NSQ
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'mytrait'
   15     1        DECLARE_CLASS                                            'controller'
   19     2        DECLARE_CLASS                                            'mycontroller', 'controller'
   28     3        NEW                                              $0      'MyController'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'myFunction'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function foo

End of class Helper.

Class MyTrait: [no user functions]
Class Controller: [no user functions]
Class MyController:
Function myfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f9NSQ
function name:  myFunction
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL_BY_NAME                                       'foo'
          1        DO_FCALL                                      0          
   25     2      > RETURN                                                   null

End of function myfunction

End of class MyController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.79 ms | 1394 KiB | 13 Q