3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); 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()) parent::doSomething(); // this will call Vendor::doSomething() :( Base::doSomething(); // this would work, without raising a strict error // 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/InjIr
function name:  (null)
number of ops:  9
compiled vars:  !0 = $local
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
   48     3        NEW                                              $2      'Local'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   49     6        INIT_METHOD_CALL                                         !0, 'doSomething'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Standalone:
Function nonstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/InjIr
function name:  nonstatic
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     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/InjIr
function name:  doSomething
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     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/InjIr
function name:  doSomething
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     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/InjIr
function name:  doSomething
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_STATIC_METHOD_CALL                                  'doSomething'
          1        DO_FCALL                                      0          
   29     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/InjIr
function name:  doSomething
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_STATIC_METHOD_CALL                                  'doSomething'
          1        DO_FCALL                                      0          
   42     2        INIT_STATIC_METHOD_CALL                                  'Base', 'doSomething'
          3        DO_FCALL                                      0          
   45     4      > RETURN                                                   null

End of function dosomething

End of class Local.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.72 ms | 1400 KiB | 15 Q