3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_mode=1); interface BarInterface { } interface ServerBarInterface { public function doBar(); } interface FooInterface { public function doFoo(BarInterface $bar); } class SomeFoo implements FooInterface { public function doFoo(ServerBarInterface $bar) { $bar->doBar(); } } class RegularBar implements BarInterface {} class ServerBar implements ServerBarInterface { public function doBar() { echo "works"; } } $foo = new SomeFoo; $bar = new RegularBar; $foo->doFoo($bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M5Buf
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   DECLARE_CLASS                                            'somefoo'
   33     1        DECLARE_CLASS                                            'regularbar'
   35     2        DECLARE_CLASS                                            'serverbar'
   46     3        NEW                                              $2      'SomeFoo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   47     6        NEW                                              $5      'RegularBar'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $5
   49     9        INIT_METHOD_CALL                                         !0, 'doFoo'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class BarInterface: [no user functions]
Class ServerBarInterface:
Function dobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M5Buf
function name:  doBar
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   null

End of function dobar

End of class ServerBarInterface.

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

End of function dofoo

End of class FooInterface.

Class SomeFoo:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M5Buf
function name:  doFoo
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        INIT_METHOD_CALL                                         !0, 'doBar'
          2        DO_FCALL                                      0          
   28     3      > RETURN                                                   null

End of function dofoo

End of class SomeFoo.

Class RegularBar: [no user functions]
Class ServerBar:
Function dobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M5Buf
function name:  doBar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   ECHO                                                     'works'
   41     1      > RETURN                                                   null

End of function dobar

End of class ServerBar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.65 ms | 1395 KiB | 13 Q