3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Standalone { public function nonstatic(){} public function doSomething() {} } class Base { public function doSomething() {} } class Vendor extends Base { public function doSomething() { // do something.. // call parent (Base::doSomething()) parent::doSomething(); // do something more } } class Local extends Vendor { public function doSomething() { // do something // intention: call grand-parent (Base::doSomething()) Base::doSomething(); // this will call Vendor::doSomething() :( // do something more } } $local = new Local; $local->doSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q3rHY
function name:  (null)
number of ops:  6
compiled vars:  !0 = $local
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   NEW                                              $1      'Local'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   45     3        INIT_METHOD_CALL                                         !0, 'doSomething'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function nonstatic

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

End of function dosomething

End of class Standalone.

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

End of function dosomething

End of class Base.

Class Vendor:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q3rHY
function name:  doSomething
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'doSomething'
          1        DO_FCALL                                      0          
   27     2      > RETURN                                                   null

End of function dosomething

End of class Vendor.

Class Local:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q3rHY
function name:  doSomething
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_STATIC_METHOD_CALL                                  'Base', 'doSomething'
          1        DO_FCALL                                      0          
   41     2      > RETURN                                                   null

End of function dosomething

End of class Local.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.52 ms | 1395 KiB | 13 Q