3v4l.org

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

Function output_shirt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cdXca
function name:  output_shirt
number of ops:  5
compiled vars:  !0 = $shirt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        INIT_METHOD_CALL                                         !0, 'test'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   28     4      > 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/cdXca
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/cdXca
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

End of class Sweater.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.6 ms | 1395 KiB | 13 Q