3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Geocoder {} interface GeocoderThatSupportsBounds {} class Base implements Geocoder{ public function speak() { return 'Foo'; } } class Google extends Base implements GeocoderThatSupportsBounds { public function speak() { return 'Bar'; } } // Third party library that expects a geocoder function normalGeocode(Geocoder $foo) { echo $foo->speak(); } // Special geocoder function geocodeWithBounds(GeocoderThatSupportsBounds $foo) { echo $foo->speak(); } $bar = new Google; normalGeocode($bar); geocodeWithBounds($bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HdCVp
function name:  (null)
number of ops:  12
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   DECLARE_CLASS                                            'base'
   10     1        DECLARE_CLASS                                            'google', 'base'
   24     2        NEW                                              $1      'Google'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   25     5        INIT_FCALL                                               'normalgeocode'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   26     8        INIT_FCALL                                               'geocodewithbounds'
          9        SEND_VAR                                                 !0
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function normalgeocode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HdCVp
function name:  normalGeocode
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_METHOD_CALL                                         !0, 'speak'
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
   17     4      > RETURN                                                   null

End of function normalgeocode

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

End of function geocodewithbounds

Class Geocoder: [no user functions]
Class GeocoderThatSupportsBounds: [no user functions]
Class Base:
Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HdCVp
function name:  speak
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'Foo'
          1*     > RETURN                                                   null

End of function speak

End of class Base.

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

End of function speak

End of class Google.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.35 ms | 1003 KiB | 15 Q