3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Product { private string $title; private string $description; private int $price; private string $currency; private string $category; private string $brand; private array $options; /** * @return string */ public function getTitle(): string { return $this->title; } /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @return string */ public function getDescription(): string { return $this->description; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @return int */ public function getPrice(): int { return $this->price; } /** * @param int $price */ public function setPrice(int $price): void { $this->price = $price; } /** * @return string */ public function getCurrency(): string { return $this->currency; } /** * @param string $currency */ public function setCurrency(string $currency): void { $this->currency = $currency; } /** * @return string */ public function getCategory(): string { return $this->category; } /** * @param string $category */ public function setCategory(string $category): void { $this->category = $category; } /** * @return string */ public function getBrand(): string { return $this->brand; } /** * @param string $brand */ public function setBrand(string $brand): void { $this->brand = $brand; } /** * @return array */ public function getOptions(): array { return $this->options; } /** * @param array $options */ public function setOptions(array $options): void { $this->options = $options; } } class Option { private string $title; private string $description; private int $price; private array $items; /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @param int $price */ public function setPrice(int $price): void { $this->price = $price; } /** * @param array $items */ public function setItems(array $items): void { $this->items = $items; } } class OptionItem { private string $title; private string $description; private int $price; /** * @param string $title */ public function setTitle(string $title): void { $this->title = $title; } /** * @param string $description */ public function setDescription(string $description): void { $this->description = $description; } /** * @param int $price */ public function setPrice(int $price): void { $this->price = $price; } } $products = []; for ($k = 0; $k <= 100; $k++) { $product = new Product(); $product->setTitle('Product' . $k); $product->setDescription('Product ' . $k . ' Description'); $product->setPrice(random_int(1000, 10000)); $product->setCurrency('USD'); $product->setCategory('Category' . $k); $product->setBrand('Brand' . $k); $options = []; for ($j = 0; $j <= 10; $j++) { $option = new Option(); $option->setTitle('Option' . $j); $option->setDescription('Option ' . $j . ' Description'); $option->setPrice(random_int(1000, 10000)); $optionItems = []; for ($i = 0; $i <= 100; $i++) { $optionItem = new OptionItem(); $optionItem->setTitle('Option Item' . $i); $optionItem->setDescription('Option Item ' . $i . ' Description'); $optionItem->setPrice(random_int(1000, 10000)); $optionItems[] = $optionItem; } $option->setItems($optionItems); $options[] = $option; } $product->setOptions($options); $products[] = $product; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 3
Branch analysis from position: 98
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
2 jumps found. (Code = 44) Position 1 = 90, Position 2 = 36
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 98, Position 2 = 3
Branch analysis from position: 98
Branch analysis from position: 3
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
2 jumps found. (Code = 44) Position 1 = 82, Position 2 = 58
Branch analysis from position: 82
2 jumps found. (Code = 44) Position 1 = 90, Position 2 = 36
Branch analysis from position: 90
Branch analysis from position: 36
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 82, Position 2 = 58
Branch analysis from position: 82
Branch analysis from position: 58
filename:       /in/IqmsA
function name:  (null)
number of ops:  99
compiled vars:  !0 = $products, !1 = $k, !2 = $product, !3 = $options, !4 = $j, !5 = $option, !6 = $optionItems, !7 = $i, !8 = $optionItem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  196     0  E >   ASSIGN                                                   !0, <array>
  197     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->96
  198     3    >   NEW                                              $11     'Product'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $11
  199     6        INIT_METHOD_CALL                                         !2, 'setTitle'
          7        CONCAT                                           ~14     'Product', !1
          8        SEND_VAL_EX                                              ~14
          9        DO_FCALL                                      0          
  200    10        INIT_METHOD_CALL                                         !2, 'setDescription'
         11        CONCAT                                           ~16     'Product+', !1
         12        CONCAT                                           ~17     ~16, '+Description'
         13        SEND_VAL_EX                                              ~17
         14        DO_FCALL                                      0          
  201    15        INIT_METHOD_CALL                                         !2, 'setPrice'
         16        INIT_FCALL                                               'random_int'
         17        SEND_VAL                                                 1000
         18        SEND_VAL                                                 10000
         19        DO_ICALL                                         $19     
         20        SEND_VAR_NO_REF_EX                                       $19
         21        DO_FCALL                                      0          
  202    22        INIT_METHOD_CALL                                         !2, 'setCurrency'
         23        SEND_VAL_EX                                              'USD'
         24        DO_FCALL                                      0          
  203    25        INIT_METHOD_CALL                                         !2, 'setCategory'
         26        CONCAT                                           ~22     'Category', !1
         27        SEND_VAL_EX                                              ~22
         28        DO_FCALL                                      0          
  204    29        INIT_METHOD_CALL                                         !2, 'setBrand'
         30        CONCAT                                           ~24     'Brand', !1
         31        SEND_VAL_EX                                              ~24
         32        DO_FCALL                                      0          
  205    33        ASSIGN                                                   !3, <array>
  206    34        ASSIGN                                                   !4, 0
         35      > JMP                                                      ->88
  207    36    >   NEW                                              $28     'Option'
         37        DO_FCALL                                      0          
         38        ASSIGN                                                   !5, $28
  208    39        INIT_METHOD_CALL                                         !5, 'setTitle'
         40        CONCAT                                           ~31     'Option', !4
         41        SEND_VAL_EX                                              ~31
         42        DO_FCALL                                      0          
  209    43        INIT_METHOD_CALL                                         !5, 'setDescription'
         44        CONCAT                                           ~33     'Option+', !4
         45        CONCAT                                           ~34     ~33, '+Description'
         46        SEND_VAL_EX                                              ~34
         47        DO_FCALL                                      0          
  210    48        INIT_METHOD_CALL                                         !5, 'setPrice'
         49        INIT_FCALL                                               'random_int'
         50        SEND_VAL                                                 1000
         51        SEND_VAL                                                 10000
         52        DO_ICALL                                         $36     
         53        SEND_VAR_NO_REF_EX                                       $36
         54        DO_FCALL                                      0          
  212    55        ASSIGN                                                   !6, <array>
  213    56        ASSIGN                                                   !7, 0
         57      > JMP                                                      ->80
  214    58    >   NEW                                              $40     'OptionItem'
         59        DO_FCALL                                      0          
         60        ASSIGN                                                   !8, $40
  215    61        INIT_METHOD_CALL                                         !8, 'setTitle'
         62        CONCAT                                           ~43     'Option+Item', !7
         63        SEND_VAL_EX                                              ~43
         64        DO_FCALL                                      0          
  216    65        INIT_METHOD_CALL                                         !8, 'setDescription'
         66        CONCAT                                           ~45     'Option+Item+', !7
         67        CONCAT                                           ~46     ~45, '+Description'
         68        SEND_VAL_EX                                              ~46
         69        DO_FCALL                                      0          
  217    70        INIT_METHOD_CALL                                         !8, 'setPrice'
         71        INIT_FCALL                                               'random_int'
         72        SEND_VAL                                                 1000
         73        SEND_VAL                                                 10000
         74        DO_ICALL                                         $48     
         75        SEND_VAR_NO_REF_EX                                       $48
         76        DO_FCALL                                      0          
  219    77        ASSIGN_DIM                                               !6
         78        OP_DATA                                                  !8
  213    79        PRE_INC                                                  !7
         80    >   IS_SMALLER_OR_EQUAL                                      !7, 100
         81      > JMPNZ                                                    ~52, ->58
  222    82    >   INIT_METHOD_CALL                                         !5, 'setItems'
         83        SEND_VAR_EX                                              !6
         84        DO_FCALL                                      0          
  223    85        ASSIGN_DIM                                               !3
         86        OP_DATA                                                  !5
  206    87        PRE_INC                                                  !4
         88    >   IS_SMALLER_OR_EQUAL                                      !4, 10
         89      > JMPNZ                                                    ~56, ->36
  225    90    >   INIT_METHOD_CALL                                         !2, 'setOptions'
         91        SEND_VAR_EX                                              !3
         92        DO_FCALL                                      0          
  226    93        ASSIGN_DIM                                               !0
         94        OP_DATA                                                  !2
  197    95        PRE_INC                                                  !1
         96    >   IS_SMALLER_OR_EQUAL                                      !1, 100
         97      > JMPNZ                                                    ~60, ->3
  227    98    > > RETURN                                                   1

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

End of function gettitle

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

End of function settitle

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

End of function getdescription

Function setdescription:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setDescription
number of ops:  4
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
   41     1        ASSIGN_OBJ                                               'description'
          2        OP_DATA                                                  !0
   42     3      > RETURN                                                   null

End of function setdescription

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

End of function getprice

Function setprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setPrice
number of ops:  4
compiled vars:  !0 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   57     1        ASSIGN_OBJ                                               'price'
          2        OP_DATA                                                  !0
   58     3      > RETURN                                                   null

End of function setprice

Function getcurrency:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  getCurrency
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   65     0  E >   FETCH_OBJ_R                                      ~0      'currency'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   66     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getcurrency

Function setcurrency:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setCurrency
number of ops:  4
compiled vars:  !0 = $currency
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   RECV                                             !0      
   73     1        ASSIGN_OBJ                                               'currency'
          2        OP_DATA                                                  !0
   74     3      > RETURN                                                   null

End of function setcurrency

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

End of function getcategory

Function setcategory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setCategory
number of ops:  4
compiled vars:  !0 = $category
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   87     0  E >   RECV                                             !0      
   89     1        ASSIGN_OBJ                                               'category'
          2        OP_DATA                                                  !0
   90     3      > RETURN                                                   null

End of function setcategory

Function getbrand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  getBrand
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   97     0  E >   FETCH_OBJ_R                                      ~0      'brand'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   98     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getbrand

Function setbrand:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setBrand
number of ops:  4
compiled vars:  !0 = $brand
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  103     0  E >   RECV                                             !0      
  105     1        ASSIGN_OBJ                                               'brand'
          2        OP_DATA                                                  !0
  106     3      > RETURN                                                   null

End of function setbrand

Function getoptions:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  getOptions
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  113     0  E >   FETCH_OBJ_R                                      ~0      'options'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
  114     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getoptions

Function setoptions:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setOptions
number of ops:  4
compiled vars:  !0 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  119     0  E >   RECV                                             !0      
  121     1        ASSIGN_OBJ                                               'options'
          2        OP_DATA                                                  !0
  122     3      > RETURN                                                   null

End of function setoptions

End of class Product.

Class Option:
Function settitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setTitle
number of ops:  4
compiled vars:  !0 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  136     0  E >   RECV                                             !0      
  138     1        ASSIGN_OBJ                                               'title'
          2        OP_DATA                                                  !0
  139     3      > RETURN                                                   null

End of function settitle

Function setdescription:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setDescription
number of ops:  4
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  144     0  E >   RECV                                             !0      
  146     1        ASSIGN_OBJ                                               'description'
          2        OP_DATA                                                  !0
  147     3      > RETURN                                                   null

End of function setdescription

Function setprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setPrice
number of ops:  4
compiled vars:  !0 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  152     0  E >   RECV                                             !0      
  154     1        ASSIGN_OBJ                                               'price'
          2        OP_DATA                                                  !0
  155     3      > RETURN                                                   null

End of function setprice

Function setitems:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setItems
number of ops:  4
compiled vars:  !0 = $items
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  160     0  E >   RECV                                             !0      
  162     1        ASSIGN_OBJ                                               'items'
          2        OP_DATA                                                  !0
  163     3      > RETURN                                                   null

End of function setitems

End of class Option.

Class OptionItem:
Function settitle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setTitle
number of ops:  4
compiled vars:  !0 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  174     0  E >   RECV                                             !0      
  176     1        ASSIGN_OBJ                                               'title'
          2        OP_DATA                                                  !0
  177     3      > RETURN                                                   null

End of function settitle

Function setdescription:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setDescription
number of ops:  4
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  182     0  E >   RECV                                             !0      
  184     1        ASSIGN_OBJ                                               'description'
          2        OP_DATA                                                  !0
  185     3      > RETURN                                                   null

End of function setdescription

Function setprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmsA
function name:  setPrice
number of ops:  4
compiled vars:  !0 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  190     0  E >   RECV                                             !0      
  192     1        ASSIGN_OBJ                                               'price'
          2        OP_DATA                                                  !0
  193     3      > RETURN                                                   null

End of function setprice

End of class OptionItem.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.44 ms | 1476 KiB | 14 Q