3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function foo() { var_dump('Calling in base class'); } } trait Bar { public function foo() { var_dump('Calling in trait'); } } class Baz extends Foo { use Bar; public function foo() { var_dump('Calling in sub class'); } } (new Baz())->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gOpDT
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'baz', 'foo'
   29     1        NEW                                              $0      'Baz'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'foo'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gOpDT
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Calling+in+base+class'
          2        DO_ICALL                                                 
    8     3      > RETURN                                                   null

End of function foo

End of class Foo.

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

End of function foo

End of class Bar.

Class Baz:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gOpDT
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'Calling+in+sub+class'
          2        DO_ICALL                                                 
   26     3      > RETURN                                                   null

End of function foo

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.1 ms | 1396 KiB | 15 Q