3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Shipping { private $company; function __construct(){ $this->company = ""; } function setStrategy($company){ $this->company = $company; } function calculate ($package){ return $this->company->calculate($package); } } interface Company { public function calculate(); } class UPS implements Company{ } class USPS implements Company{ } class FedEx implements Company { }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CWtAT
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   DECLARE_CLASS                                            'ups'
   28     1        DECLARE_CLASS                                            'usps'
   31     2        DECLARE_CLASS                                            'fedex'
   33     3      > RETURN                                                   1

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

End of function __construct

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

End of function setstrategy

Function calculate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CWtAT
function name:  calculate
number of ops:  7
compiled vars:  !0 = $package
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        FETCH_OBJ_R                                      ~1      'company'
          2        INIT_METHOD_CALL                                         ~1, 'calculate'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   20     6*     > RETURN                                                   null

End of function calculate

End of class Shipping.

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

End of function calculate

End of class Company.

Class UPS: [no user functions]
Class USPS: [no user functions]
Class FedEx: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.31 ms | 1395 KiB | 13 Q