3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'start'; function recuperation_info_product_et_decrementation($reference, $qty, $isDeclinaison){ /* Fonction de récupèration et décrementation produit */ $product_infos = array(); $tables = array('product_attribute'); if($isDeclinaison === false) { array_unshift($tables, 'product'); } foreach($tables as $table) { $query = 'SELECT * FROM `'._DB_PREFIX_.$table.'` WHERE `reference` = "'.$reference.'";'; $result = Db::getInstance()->executeS($query); if($result !== false) { $product_infos = $result[0]; decremente_stock($product_infos['id_product'], $qty, $reference, $table); break; } } return $product_infos; } /* fonction qui retourne l'IdProduct et l'IdProductAttribute du produit commandé */ function recuperation_idProduct_idProductAttribute($reference){ $product_infos = array(); $query = 'SELECT * FROM `'._DB_PREFIX_.'product` WHERE `reference` = "'.pSQL($reference).'";'; $result = Db::getInstance()->executeS($query); $product_infos['id_product'] = $result[0]['id_product']; $query = 'SELECT * FROM `'._DB_PREFIX_.'product_attribute` WHERE `reference` = "'.pSQL($reference).'";'; $result = Db::getInstance()->executeS($query); $product_infos['id_product_attribute'] = $result[0]['id_product_attribute']; return $product_infos; } echo 'done';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a8PPI
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'start'
   41     1        ECHO                                                     'done'
          2      > RETURN                                                   1

Function recuperation_info_product_et_decrementation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 40
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 40
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 39
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 40
Branch analysis from position: 40
Branch analysis from position: 11
filename:       /in/a8PPI
function name:  recuperation_info_product_et_decrementation
number of ops:  43
compiled vars:  !0 = $reference, !1 = $qty, !2 = $isDeclinaison, !3 = $product_infos, !4 = $tables, !5 = $table, !6 = $query, !7 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        ASSIGN                                                   !3, <array>
    5     4        ASSIGN                                                   !4, <array>
    7     5        TYPE_CHECK                                    4          !2
          6      > JMPZ                                                     ~10, ->11
    8     7    >   INIT_FCALL                                               'array_unshift'
          8        SEND_REF                                                 !4
          9        SEND_VAL                                                 'product'
         10        DO_ICALL                                                 
   11    11    > > FE_RESET_R                                       $12     !4, ->40
         12    > > FE_FETCH_R                                               $12, !5, ->40
   12    13    >   FETCH_CONSTANT                                   ~13     '_DB_PREFIX_'
         14        CONCAT                                           ~14     'SELECT+%2A+FROM+%60', ~13
         15        CONCAT                                           ~15     ~14, !5
         16        CONCAT                                           ~16     ~15, '%60+WHERE+%60reference%60+%3D+%22'
         17        CONCAT                                           ~17     ~16, !0
         18        CONCAT                                           ~18     ~17, '%22%3B'
         19        ASSIGN                                                   !6, ~18
   13    20        INIT_STATIC_METHOD_CALL                                  'Db', 'getInstance'
         21        DO_FCALL                                      0  $20     
         22        INIT_METHOD_CALL                                         $20, 'executeS'
         23        SEND_VAR_EX                                              !6
         24        DO_FCALL                                      0  $21     
         25        ASSIGN                                                   !7, $21
   14    26        TYPE_CHECK                                  1018          !7
         27      > JMPZ                                                     ~23, ->39
   15    28    >   FETCH_DIM_R                                      ~24     !7, 0
         29        ASSIGN                                                   !3, ~24
   16    30        INIT_FCALL_BY_NAME                                       'decremente_stock'
         31        CHECK_FUNC_ARG                                           
         32        FETCH_DIM_FUNC_ARG                               $26     !3, 'id_product'
         33        SEND_FUNC_ARG                                            $26
         34        SEND_VAR_EX                                              !1
         35        SEND_VAR_EX                                              !0
         36        SEND_VAR_EX                                              !5
         37        DO_FCALL                                      0          
   17    38      > JMP                                                      ->40
   11    39    > > JMP                                                      ->12
         40    >   FE_FREE                                                  $12
   21    41      > RETURN                                                   !3
   22    42*     > RETURN                                                   null

End of function recuperation_info_product_et_decrementation

Function recuperation_idproduct_idproductattribute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a8PPI
function name:  recuperation_idProduct_idProductAttribute
number of ops:  42
compiled vars:  !0 = $reference, !1 = $product_infos, !2 = $query, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        ASSIGN                                                   !1, <array>
   28     2        FETCH_CONSTANT                                   ~5      '_DB_PREFIX_'
          3        CONCAT                                           ~6      'SELECT+%2A+FROM+%60', ~5
          4        CONCAT                                           ~7      ~6, 'product%60+WHERE+%60reference%60+%3D+%22'
          5        INIT_FCALL_BY_NAME                                       'pSQL'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $8      
          8        CONCAT                                           ~9      ~7, $8
          9        CONCAT                                           ~10     ~9, '%22%3B'
         10        ASSIGN                                                   !2, ~10
   29    11        INIT_STATIC_METHOD_CALL                                  'Db', 'getInstance'
         12        DO_FCALL                                      0  $12     
         13        INIT_METHOD_CALL                                         $12, 'executeS'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $13     
         16        ASSIGN                                                   !3, $13
   30    17        FETCH_DIM_R                                      ~16     !3, 0
         18        FETCH_DIM_R                                      ~17     ~16, 'id_product'
         19        ASSIGN_DIM                                               !1, 'id_product'
         20        OP_DATA                                                  ~17
   32    21        FETCH_CONSTANT                                   ~18     '_DB_PREFIX_'
         22        CONCAT                                           ~19     'SELECT+%2A+FROM+%60', ~18
         23        CONCAT                                           ~20     ~19, 'product_attribute%60+WHERE+%60reference%60+%3D+%22'
         24        INIT_FCALL_BY_NAME                                       'pSQL'
         25        SEND_VAR_EX                                              !0
         26        DO_FCALL                                      0  $21     
         27        CONCAT                                           ~22     ~20, $21
         28        CONCAT                                           ~23     ~22, '%22%3B'
         29        ASSIGN                                                   !2, ~23
   33    30        INIT_STATIC_METHOD_CALL                                  'Db', 'getInstance'
         31        DO_FCALL                                      0  $25     
         32        INIT_METHOD_CALL                                         $25, 'executeS'
         33        SEND_VAR_EX                                              !2
         34        DO_FCALL                                      0  $26     
         35        ASSIGN                                                   !3, $26
   34    36        FETCH_DIM_R                                      ~29     !3, 0
         37        FETCH_DIM_R                                      ~30     ~29, 'id_product_attribute'
         38        ASSIGN_DIM                                               !1, 'id_product_attribute'
         39        OP_DATA                                                  ~30
   36    40      > RETURN                                                   !1
   37    41*     > RETURN                                                   null

End of function recuperation_idproduct_idproductattribute

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.8 ms | 1409 KiB | 15 Q