3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); interface Animal {} class Cat implements Animal {} class Shelter { function adopt(Animal $a) {} } class CatShelter { function adopt(Cat $a) {} } $cat = new Cat; $shelter = new Shelter; $shelter->adopt($cat); $catShelter = new CatShelter; $catShelter->adopt($cat);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m0pls
function name:  (null)
number of ops:  20
compiled vars:  !0 = $cat, !1 = $shelter, !2 = $catShelter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    7     3        DECLARE_CLASS                                            'cat'
   18     4        NEW                                              $4      'Cat'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   20     7        NEW                                              $7      'Shelter'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   21    10        INIT_METHOD_CALL                                         !1, 'adopt'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   23    13        NEW                                              $11     'CatShelter'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !2, $11
   24    16        INIT_METHOD_CALL                                         !2, 'adopt'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0          
         19      > RETURN                                                   1

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

End of function adopt

End of class Shelter.

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

End of function adopt

End of class CatShelter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
309.14 ms | 1396 KiB | 15 Q