3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function baz(){} } class B extends A{ function bar(){} } class C extends B{ function qux(){} } abstract class DecoratedA{ // DecoratorA || ForwardingA || DelegatingA protected $wrap; function __construct(A $a){ $this->wrap = $a; } function baz(){ return $this->wrap->baz(); } } abstract class DecoratedB extends DecoratedA{ // DecoratorB || ForwardingB || DelegatingB function __construct(B $b){ parent::construct($b); } function bar(){ return $this->wrap->bar(); } } abstract class DecoratedC extends DecoratedB{ // DecoratorC || ForwardingC || DelegatingC function __construct(C $c){ parent::construct($c); } function qux(){ return $this->wrap->qux(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E > > RETURN                                                   1

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

End of function baz

End of class A.

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

End of function bar

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

End of function baz

End of class B.

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

End of function qux

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

End of function bar

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

End of function baz

End of class C.

Class DecoratedA:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  __construct
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        ASSIGN_OBJ                                               'wrap'
          2        OP_DATA                                                  !0
   19     3      > RETURN                                                   null

End of function __construct

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  baz
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'wrap'
          1        INIT_METHOD_CALL                                         ~0, 'baz'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   22     4*     > RETURN                                                   null

End of function baz

End of class DecoratedA.

Class DecoratedB:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  __construct
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        INIT_STATIC_METHOD_CALL                                  'construct'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   28     4      > RETURN                                                   null

End of function __construct

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'wrap'
          1        INIT_METHOD_CALL                                         ~0, 'bar'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   31     4*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  baz
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'wrap'
          1        INIT_METHOD_CALL                                         ~0, 'baz'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   22     4*     > RETURN                                                   null

End of function baz

End of class DecoratedB.

Class DecoratedC:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  __construct
number of ops:  5
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
   36     1        INIT_STATIC_METHOD_CALL                                  'construct'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   37     4      > RETURN                                                   null

End of function __construct

Function qux:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  qux
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   FETCH_OBJ_R                                      ~0      'wrap'
          1        INIT_METHOD_CALL                                         ~0, 'qux'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   40     4*     > RETURN                                                   null

End of function qux

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'wrap'
          1        INIT_METHOD_CALL                                         ~0, 'bar'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   31     4*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2huid
function name:  baz
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                      ~0      'wrap'
          1        INIT_METHOD_CALL                                         ~0, 'baz'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   22     4*     > RETURN                                                   null

End of function baz

End of class DecoratedC.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.71 ms | 1457 KiB | 13 Q