3v4l.org

run code in 300+ PHP versions simultaneously
<?php // lib 1 code: interface Lib1Interface { // name was originally $myparam, but has been changed. public function method($mychangedparam); } // lib 2 code: class Lib2Implementation implements Lib1Interface { public function method($myparam) { echo $myparam; } } // your code: class MyImplementation implements Lib1Interface { public function method($mychangedparam) { echo $mychangedparam; } } function doStuff(Lib1Interface $interface) { // named params can't be used here because of implementation details elsewhere. this is very opaque. $interface->method(mychangedparam: 42); } doStuff(new Lib2Implementation()); doStuff(new MyImplementation());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSSo9
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'lib2implementation'
   20     1        DECLARE_CLASS                                            'myimplementation'
   34     2        INIT_FCALL                                               'dostuff'
          3        NEW                                              $0      'Lib2Implementation'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0          
   35     7        INIT_FCALL                                               'dostuff'
          8        NEW                                              $3      'MyImplementation'
          9        DO_FCALL                                      0          
         10        SEND_VAR                                                 $3
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSSo9
function name:  doStuff
number of ops:  6
compiled vars:  !0 = $interface
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   31     1        INIT_METHOD_CALL                                         !0, 'method'
          2        SEND_VAL_EX                                              42, 'mychangedparam'
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      1          
   32     5      > RETURN                                                   null

End of function dostuff

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

End of function method

End of class Lib1Interface.

Class Lib2Implementation:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSSo9
function name:  method
number of ops:  3
compiled vars:  !0 = $myparam
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        ECHO                                                     !0
   16     2      > RETURN                                                   null

End of function method

End of class Lib2Implementation.

Class MyImplementation:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XSSo9
function name:  method
number of ops:  3
compiled vars:  !0 = $mychangedparam
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ECHO                                                     !0
   25     2      > RETURN                                                   null

End of function method

End of class MyImplementation.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.34 ms | 1003 KiB | 15 Q