3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Comparable { public function compare(self $compare); } // Which is then implemented: class Foo implements Comparable { public function compare(self $compare) {} } class Bar implements Comparable { public function compare(self $compare) {} } $foo = new Foo(); $bar = new Bar(); $foo->compare($bar); $bar->compare($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j0v4O
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'foo'
   15     1        DECLARE_CLASS                                            'bar'
   21     2        NEW                                              $2      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   22     5        NEW                                              $5      'Bar'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   24     8        INIT_METHOD_CALL                                         !0, 'compare'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
   25    11        INIT_METHOD_CALL                                         !1, 'compare'
         12        SEND_VAR_EX                                              !0
         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/j0v4O
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/j0v4O
function name:  compare
number of ops:  2
compiled vars:  !0 = $compare
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     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/j0v4O
function name:  compare
number of ops:  2
compiled vars:  !0 = $compare
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1      > RETURN                                                   null

End of function compare

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.07 ms | 1386 KiB | 13 Q