3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { abstract public function doStuff(); public function main() { $this->doStuff(); } } class Bar { use Foo { Foo::doStuff as doOtherStuff; } public function doStuff() { var_dump(__FUNCTION__); } } $b = new Bar(); $b->main();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vDEP9
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'bar'
   21     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_METHOD_CALL                                         !0, 'main'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function dostuff

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

End of function main

End of class Foo.

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

End of function dostuff

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.65 ms | 1400 KiB | 15 Q