3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Dog { public function woof(); } class Terrier implements Dog { public function woof() { echo 'woof'; } } class Staffie extends Terrier { } $dog = new Staffie(); theBestDog($dog); function theBestDog(Dog $dog){ $dog->woof(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cNWq0
function name:  (null)
number of ops:  9
compiled vars:  !0 = $dog
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'terrier'
   13     1        DECLARE_CLASS                                            'staffie', 'terrier'
   17     2        NEW                                              $1      'Staffie'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   18     5        INIT_FCALL_BY_NAME                                       'theBestDog'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
   22     8      > RETURN                                                   1

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

End of function thebestdog

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

End of function woof

End of class Dog.

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

End of function woof

End of class Terrier.

Class Staffie: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.76 ms | 1385 KiB | 13 Q