3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait FooTrait { public function doFoo() { $this->doBar(); } } class Bar { use FooTrait; public function doBar() { var_dump('bar'); } } class Baz { use FooTrait; } (new Bar())->doFoo(); (new Baz())->doFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XQ0Y4
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'bar'
   25     1        DECLARE_CLASS                                            'baz'
   32     2        NEW                                              $0      'Bar'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'doFoo'
          5        DO_FCALL                                      0          
   33     6        NEW                                              $3      'Baz'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $3, 'doFoo'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class FooTrait:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XQ0Y4
function name:  doFoo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_METHOD_CALL                                         'doBar'
          1        DO_FCALL                                      0          
    9     2      > RETURN                                                   null

End of function dofoo

End of class FooTrait.

Class Bar:
Function dobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XQ0Y4
function name:  doBar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'bar'
          2        DO_ICALL                                                 
   21     3      > RETURN                                                   null

End of function dobar

End of class Bar.

Class Baz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.66 ms | 1406 KiB | 15 Q