3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Shirt { public function test() { return "Shirt"; } } class Sweater extends Shirt { public function test() { return "Sweater"; } public function doSweaterStuff() { echo "This is a sweater!"; } } $shirt = new Shirt(); output_shirt($shirt); function output_shirt(Sweater $sweater) { $sweater->doSweaterStuff(); echo $sweater->test(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u7gXP
function name:  (null)
number of ops:  7
compiled vars:  !0 = $shirt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'Shirt'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   29     3        INIT_FCALL_BY_NAME                                       'output_shirt'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   34     6      > RETURN                                                   1

Function output_shirt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u7gXP
function name:  output_shirt
number of ops:  7
compiled vars:  !0 = $sweater
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   32     1        INIT_METHOD_CALL                                         !0, 'doSweaterStuff'
          2        DO_FCALL                                      0          
   33     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
   34     6      > RETURN                                                   null

End of function output_shirt

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

End of function test

End of class Shirt.

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

End of function test

Function dosweaterstuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u7gXP
function name:  doSweaterStuff
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ECHO                                                     'This+is+a+sweater%21'
   24     1      > RETURN                                                   null

End of function dosweaterstuff

End of class Sweater.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.4 ms | 1386 KiB | 13 Q