3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface Animal { } class Dog implements Animal { } class Pet { public function __construct(Animal $animal) { } public function getName() { echo get_class($this); } } class RescuePet extends Pet { public function __construct(Dog $animal) { } } $f = new RescuePet(new Dog()); $f->getName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pOokj
function name:  (null)
number of ops:  10
compiled vars:  !0 = $f
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                                'dog'
   22     1        NEW                                                  $1      'RescuePet'
          2        NEW                                                  $2      'Dog'
          3        DO_FCALL                                          0          
          4        SEND_VAR_NO_REF_EX                                           $2
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !0, $1
   23     7        INIT_METHOD_CALL                                             !0, 'getName'
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Class Animal: [no user functions]
Class Dog: [no user functions]
Class Pet:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pOokj
function name:  __construct
number of ops:  2
compiled vars:  !0 = $animal
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   12     1      > RETURN                                                       null

End of function __construct

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pOokj
function name:  getName
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                           ~0      
          1        GET_CLASS                                            ~1      ~0
          2        ECHO                                                         ~1
   15     3      > RETURN                                                       null

End of function getname

End of class Pet.

Class RescuePet:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pOokj
function name:  __construct
number of ops:  2
compiled vars:  !0 = $animal
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   20     1      > RETURN                                                       null

End of function __construct

Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pOokj
function name:  getName
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   FETCH_THIS                                           ~0      
          1        GET_CLASS                                            ~1      ~0
          2        ECHO                                                         ~1
   15     3      > RETURN                                                       null

End of function getname

End of class RescuePet.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.72 ms | 477 KiB | 7 Q