3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Products{ // Properties protected $_title; protected $_category; // Methods public function __construct($title, $category){ $this->_title = $title; $this->_category = $category; } public function getCategory(){ return $this->_category; } public function getTitle(){ return $this->_title; } } class Order extends Products{ // Properties protected $_price; protected $_deliver; // Methods public function __construct($title, $category, $price){ $this->_title = $title; $this->_category = $category; $this->_price = $price; $this->freeDomesticShipment(); // method called } public function getPrice(){ return $this->_price; } public function getDeliver(){ return $this->_deliver; } protected function freeDomesticShipment(){ $this->_deliver = $this->_price > 30 ? 'Yes' : 'No' ; } } $order = new Order('CD Brahms', 'Media', '45'); echo $order->getTitle(); // displays CD Brahms
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  (null)
number of ops:  10
compiled vars:  !0 = $order
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   NEW                                              $1      'Order'
          1        SEND_VAL_EX                                              'CD+Brahms'
          2        SEND_VAL_EX                                              'Media'
          3        SEND_VAL_EX                                              '45'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   43     6        INIT_METHOD_CALL                                         !0, 'getTitle'
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

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

End of function __construct

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

End of function getcategory

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  getTitle
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      '_title'
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function gettitle

End of class Products.

Class Order:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  __construct
number of ops:  12
compiled vars:  !0 = $title, !1 = $category, !2 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   26     3        ASSIGN_OBJ                                               '_title'
          4        OP_DATA                                                  !0
   27     5        ASSIGN_OBJ                                               '_category'
          6        OP_DATA                                                  !1
   28     7        ASSIGN_OBJ                                               '_price'
          8        OP_DATA                                                  !2
   29     9        INIT_METHOD_CALL                                         'freeDomesticShipment'
         10        DO_FCALL                                      0          
   30    11      > RETURN                                                   null

End of function __construct

Function getprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  getPrice
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   FETCH_OBJ_R                                      ~0      '_price'
          1      > RETURN                                                   ~0
   33     2*     > RETURN                                                   null

End of function getprice

Function getdeliver:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  getDeliver
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   FETCH_OBJ_R                                      ~0      '_deliver'
          1      > RETURN                                                   ~0
   36     2*     > RETURN                                                   null

End of function getdeliver

Function freedomesticshipment:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  freeDomesticShipment
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   FETCH_OBJ_R                                      ~1      '_price'
          1        IS_SMALLER                                               30, ~1
          2      > JMPZ                                                     ~2, ->5
          3    >   QM_ASSIGN                                        ~3      'Yes'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~3      'No'
          6    >   ASSIGN_OBJ                                               '_deliver'
          7        OP_DATA                                                  ~3
   39     8      > RETURN                                                   null

End of function freedomesticshipment

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

End of function getcategory

Function gettitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xbe4D
function name:  getTitle
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      '_title'
          1      > RETURN                                                   ~0
   17     2*     > RETURN                                                   null

End of function gettitle

End of class Order.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.6 ms | 1403 KiB | 13 Q