3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); interface IDoSomething { public static function doSomething(); } class One implements IDoSomething { public static function doSomething() { echo "One is doing something\n"; } } class Two extends One { public static function doSomething() { echo "Two is doing something\n"; } } function example(IDoSomething $doer) { $doer->doSomething(); } example(new One()); // One is doing something example(new Two()); // Two is doing something
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ncaDN
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    8     3        DECLARE_CLASS                                            'one'
   14     4        DECLARE_CLASS                                            'two', 'one'
   24     5        INIT_FCALL                                               'example'
          6        NEW                                              $1      'One'
          7        DO_FCALL                                      0          
          8        SEND_VAR                                                 $1
          9        DO_FCALL                                      0          
   25    10        INIT_FCALL                                               'example'
         11        NEW                                              $4      'Two'
         12        DO_FCALL                                      0          
         13        SEND_VAR                                                 $4
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function example:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ncaDN
function name:  example
number of ops:  4
compiled vars:  !0 = $doer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_METHOD_CALL                                         !0, 'doSomething'
          2        DO_FCALL                                      0          
   22     3      > RETURN                                                   null

End of function example

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

End of function dosomething

End of class IDoSomething.

Class One:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ncaDN
function name:  doSomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'One+is+doing+something%0A'
   11     1      > RETURN                                                   null

End of function dosomething

End of class One.

Class Two:
Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ncaDN
function name:  doSomething
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'Two+is+doing+something%0A'
   17     1      > RETURN                                                   null

End of function dosomething

End of class Two.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.22 ms | 1394 KiB | 17 Q