3v4l.org

run code in 300+ PHP versions simultaneously
<?php Interface ShapeInterface { public function getArea(); } Class ShapeManager { public function __construct(ShapeInterface $shape) { $this->shape = $shape; } public function getArea() { $this->shape->getArea(); } } Class Circle { public function getArea() { return 'circle area'; } } Class Sqaure { public function getArea() { return 'square area'; } } $shape = new ShapeManager(new Circle); $shape->getArea();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QYZPm
function name:  (null)
number of ops:  9
compiled vars:  !0 = $shape
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'ShapeManager'
          1        NEW                                              $2      'Circle'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   31     6        INIT_METHOD_CALL                                         !0, 'getArea'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function getarea

End of class ShapeInterface.

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

End of function __construct

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

End of function getarea

End of class ShapeManager.

Class Circle:
Function getarea:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QYZPm
function name:  getArea
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   'circle+area'
   20     1*     > RETURN                                                   null

End of function getarea

End of class Circle.

Class Sqaure:
Function getarea:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QYZPm
function name:  getArea
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   'square+area'
   26     1*     > RETURN                                                   null

End of function getarea

End of class Sqaure.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.69 ms | 1399 KiB | 13 Q