3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface Comparable { function compare(self $compare); } class Foo implements Comparable { function compare(Comparable $compare) {} } class Bar implements Comparable { function compare(Comparable $compare) {} } $foo = new Foo(); $bar = new Bar(); $foo->compare($foo); $bar->compare($bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LL1DG
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                                'foo'
   11     1        DECLARE_CLASS                                                'bar'
   15     2        NEW                                                  $2      'Foo'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   16     5        NEW                                                  $5      'Bar'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $5
   18     8        INIT_METHOD_CALL                                             !0, 'compare'
          9        SEND_VAR_EX                                                  !0
         10        DO_FCALL                                          0          
   19    11        INIT_METHOD_CALL                                             !1, 'compare'
         12        SEND_VAR_EX                                                  !1
         13        DO_FCALL                                          0          
         14      > RETURN                                                       1

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

End of function compare

End of class Comparable.

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

End of function compare

End of class Foo.

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

End of function compare

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
216.61 ms | 2797 KiB | 13 Q