3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Vendor { public function make(); } class Samsung implements Vendor{ public function make() :string { return "This is Samsung product"; } } class Galaxy extends Samsung { public function make() { return new Samsung(); } } $vendor = new Samsung(); echo $vendor->make();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W4l0H
function name:  (null)
number of ops:  9
compiled vars:  !0 = $vendor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'samsung'
   12     1        DECLARE_CLASS                                            'galaxy', 'samsung'
   18     2        NEW                                              $1      'Samsung'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   19     5        INIT_METHOD_CALL                                         !0, 'make'
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
          8      > RETURN                                                   1

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

End of function make

End of class Vendor.

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

End of function make

End of class Samsung.

Class Galaxy:
Function make:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W4l0H
function name:  make
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'Samsung'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   15     3*     > RETURN                                                   null

End of function make

End of class Galaxy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.68 ms | 1395 KiB | 13 Q