3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface ContainerInterface1 { public function get($id); } interface ContainerInterface2 { public function get($id, $params = [], $setters = [], $shared = true); } class Container implements ContainerInterface1, ContainerInterface2 { public function get($id, $params = [], $setters = [], $shared = true) { return $id; } } class Y { public function setContainer(ContainerInterface1 $value) { $this->value = $value; } } $container = new Container(); var_dump($container instanceof ContainerInterface1); var_dump($container instanceof ContainerInterface2); echo $container->get('hello'); $y = new Y(); $y->setContainer($container);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bB0Oj
function name:  (null)
number of ops:  23
compiled vars:  !0 = $container, !1 = $y
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                                'container'
   29     1        NEW                                                  $2      'Container'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   30     4        INIT_FCALL                                                   'var_dump'
          5        INSTANCEOF                                           ~5      !0, 'ContainerInterface1'
          6        SEND_VAL                                                     ~5
          7        DO_ICALL                                                     
   31     8        INIT_FCALL                                                   'var_dump'
          9        INSTANCEOF                                           ~7      !0, 'ContainerInterface2'
         10        SEND_VAL                                                     ~7
         11        DO_ICALL                                                     
   32    12        INIT_METHOD_CALL                                             !0, 'get'
         13        SEND_VAL_EX                                                  'hello'
         14        DO_FCALL                                          0  $9      
         15        ECHO                                                         $9
   34    16        NEW                                                  $10     'Y'
         17        DO_FCALL                                          0          
         18        ASSIGN                                                       !1, $10
   35    19        INIT_METHOD_CALL                                             !1, 'setContainer'
         20        SEND_VAR_EX                                                  !0
         21        DO_FCALL                                          0          
         22      > RETURN                                                       1

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

End of function get

End of class ContainerInterface1.

Class ContainerInterface2:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bB0Oj
function name:  get
number of ops:  5
compiled vars:  !0 = $id, !1 = $params, !2 = $setters, !3 = $shared
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
          2        RECV_INIT                                            !2      <array>
          3        RECV_INIT                                            !3      <true>
          4      > RETURN                                                       null

End of function get

End of class ContainerInterface2.

Class Container:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bB0Oj
function name:  get
number of ops:  6
compiled vars:  !0 = $id, !1 = $params, !2 = $setters, !3 = $shared
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
          2        RECV_INIT                                            !2      <array>
          3        RECV_INIT                                            !3      <true>
   17     4      > RETURN                                                       !0
   18     5*     > RETURN                                                       null

End of function get

End of class Container.

Class Y:
Function setcontainer:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bB0Oj
function name:  setContainer
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   RECV                                                 !0      
   25     1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
   26     3      > RETURN                                                       null

End of function setcontainer

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.32 ms | 2167 KiB | 14 Q