3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PaypalExpress extends PaypalAPI { protected $_logs = array(); public function home($params) { global $smarty; return $this->display(__FILE__, 'shopping_cart.tpl'); } public function getAuthorisation() { global $cookie; // Getting cart informations $cart = new Cart(intval($cookie->id_cart)); if (!Validate::isLoadedObject($cart)) $this->_logs[] = $this->l('Not a valid cart'); $currency = new Currency(intval($cart->id_currency)); //оригинал // $currency = new Currency(2); if (!Validate::isLoadedObject($currency)) $this->_logs[] = $this->l('Not a valid currency'); if (sizeof($this->_logs)) return false; // Making request $returnURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/paypalapi/express/submit.php'; $cancelURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'order.php'; $paymentAmount = number_format(floatval($cart->getOrderTotal()), 2, '.', ''); //оригинал // $paymentAmount = number_format(floatval(Tools::convertPrice($cart->getOrderTotal(),$currency)), 2, '.', ''); $currencyCodeType = strval($currency->iso_code); $paymentType = 'Sale'; $request = '&Amt='.urlencode($paymentAmount).'&PAYMENTACTION='.urlencode($paymentType).'&ReturnUrl='.urlencode($returnURL).'&CANCELURL='.urlencode($cancelURL).'&CURRENCYCODE='.urlencode($currencyCodeType); if ($this->_header) $request .= '&HDRIMG='.urlencode($this->_header); //print_r($request);exit; // Calling PayPal API include(_PS_MODULE_DIR_.'paypalapi/api/PaypalLib.php'); $ppAPI = new PaypalLib(); $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request); $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); return $result; } public function getCustomerInfos() { global $cookie; // Making request $request = '&TOKEN='.urlencode(strval($cookie->paypal_token)); // Calling PayPal API include(_PS_MODULE_DIR_.'paypalapi/api/PaypalLib.php'); $ppAPI = new PaypalLib(); $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'GetExpressCheckoutDetails', $request); $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); return $result; } public function getLogs() { return $this->_logs; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cDG1P
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'paypalexpress', 'paypalapi'
   71     1      > RETURN                                                   1

Class PaypalExpress:
Function home:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cDG1P
function name:  home
number of ops:  8
compiled vars:  !0 = $params, !1 = $smarty
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        BIND_GLOBAL                                              !1, 'smarty'
   11     2        INIT_METHOD_CALL                                         'display'
          3        SEND_VAL_EX                                              '%2Fin%2FcDG1P'
          4        SEND_VAL_EX                                              'shopping_cart.tpl'
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   12     7*     > RETURN                                                   null

End of function home

Function getauthorisation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 118, Position 2 = 124
Branch analysis from position: 118
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 124
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 118, Position 2 = 124
Branch analysis from position: 118
Branch analysis from position: 124
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
Branch analysis from position: 64
Branch analysis from position: 35
Branch analysis from position: 18
filename:       /in/cDG1P
function name:  getAuthorisation
number of ops:  152
compiled vars:  !0 = $cookie, !1 = $cart, !2 = $currency, !3 = $returnURL, !4 = $cancelURL, !5 = $paymentAmount, !6 = $currencyCodeType, !7 = $paymentType, !8 = $request, !9 = $ppAPI, !10 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   BIND_GLOBAL                                              !0, 'cookie'
   19     1        NEW                                              $11     'Cart'
          2        FETCH_OBJ_R                                      ~12     !0, 'id_cart'
          3        CAST                                          4  ~13     ~12
          4        SEND_VAL_EX                                              ~13
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $11
   20     7        INIT_STATIC_METHOD_CALL                                  'Validate', 'isLoadedObject'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0  $16     
         10        BOOL_NOT                                         ~17     $16
         11      > JMPZ                                                     ~17, ->18
   21    12    >   INIT_METHOD_CALL                                         'l'
         13        SEND_VAL_EX                                              'Not+a+valid+cart'
         14        DO_FCALL                                      0  $20     
         15        FETCH_OBJ_W                                      $18     '_logs'
         16        ASSIGN_DIM                                               $18
         17        OP_DATA                                                  $20
   22    18    >   NEW                                              $21     'Currency'
         19        FETCH_OBJ_R                                      ~22     !1, 'id_currency'
         20        CAST                                          4  ~23     ~22
         21        SEND_VAL_EX                                              ~23
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !2, $21
   24    24        INIT_STATIC_METHOD_CALL                                  'Validate', 'isLoadedObject'
         25        SEND_VAR_EX                                              !2
         26        DO_FCALL                                      0  $26     
         27        BOOL_NOT                                         ~27     $26
         28      > JMPZ                                                     ~27, ->35
   25    29    >   INIT_METHOD_CALL                                         'l'
         30        SEND_VAL_EX                                              'Not+a+valid+currency'
         31        DO_FCALL                                      0  $30     
         32        FETCH_OBJ_W                                      $28     '_logs'
         33        ASSIGN_DIM                                               $28
         34        OP_DATA                                                  $30
   27    35    >   FETCH_OBJ_R                                      ~31     '_logs'
         36        COUNT                                            ~32     ~31
         37      > JMPZ                                                     ~32, ->39
   28    38    > > RETURN                                                   <false>
   31    39    >   INIT_STATIC_METHOD_CALL                                  'Configuration', 'get'
         40        SEND_VAL_EX                                              'PS_SSL_ENABLED'
         41        DO_FCALL                                      0  $33     
         42      > JMPZ                                                     $33, ->45
         43    >   QM_ASSIGN                                        ~34     'https%3A%2F%2F'
         44      > JMP                                                      ->46
         45    >   QM_ASSIGN                                        ~34     'http%3A%2F%2F'
         46    >   INIT_FCALL                                               'htmlspecialchars'
         47        FETCH_R                      global              ~35     '_SERVER'
         48        FETCH_DIM_R                                      ~36     ~35, 'HTTP_HOST'
         49        SEND_VAL                                                 ~36
         50        SEND_VAL                                                 2
         51        SEND_VAL                                                 'UTF-8'
         52        DO_ICALL                                         $37     
         53        CONCAT                                           ~38     ~34, $37
         54        FETCH_CONSTANT                                   ~39     '__PS_BASE_URI__'
         55        CONCAT                                           ~40     ~38, ~39
         56        CONCAT                                           ~41     ~40, 'modules%2Fpaypalapi%2Fexpress%2Fsubmit.php'
         57        ASSIGN                                                   !3, ~41
   32    58        INIT_STATIC_METHOD_CALL                                  'Configuration', 'get'
         59        SEND_VAL_EX                                              'PS_SSL_ENABLED'
         60        DO_FCALL                                      0  $43     
         61      > JMPZ                                                     $43, ->64
         62    >   QM_ASSIGN                                        ~44     'https%3A%2F%2F'
         63      > JMP                                                      ->65
         64    >   QM_ASSIGN                                        ~44     'http%3A%2F%2F'
         65    >   INIT_FCALL                                               'htmlspecialchars'
         66        FETCH_R                      global              ~45     '_SERVER'
         67        FETCH_DIM_R                                      ~46     ~45, 'HTTP_HOST'
         68        SEND_VAL                                                 ~46
         69        SEND_VAL                                                 2
         70        SEND_VAL                                                 'UTF-8'
         71        DO_ICALL                                         $47     
         72        CONCAT                                           ~48     ~44, $47
         73        FETCH_CONSTANT                                   ~49     '__PS_BASE_URI__'
         74        CONCAT                                           ~50     ~48, ~49
         75        CONCAT                                           ~51     ~50, 'order.php'
         76        ASSIGN                                                   !4, ~51
   33    77        INIT_FCALL                                               'number_format'
         78        INIT_METHOD_CALL                                         !1, 'getOrderTotal'
         79        DO_FCALL                                      0  $53     
         80        CAST                                          5  ~54     $53
         81        SEND_VAL                                                 ~54
         82        SEND_VAL                                                 2
         83        SEND_VAL                                                 '.'
         84        SEND_VAL                                                 ''
         85        DO_ICALL                                         $55     
         86        ASSIGN                                                   !5, $55
   36    87        FETCH_OBJ_R                                      ~57     !2, 'iso_code'
         88        CAST                                          6  ~58     ~57
         89        ASSIGN                                                   !6, ~58
   37    90        ASSIGN                                                   !7, 'Sale'
   38    91        INIT_FCALL                                               'urlencode'
         92        SEND_VAR                                                 !5
         93        DO_ICALL                                         $61     
         94        CONCAT                                           ~62     '%26Amt%3D', $61
         95        CONCAT                                           ~63     ~62, '%26PAYMENTACTION%3D'
         96        INIT_FCALL                                               'urlencode'
         97        SEND_VAR                                                 !7
         98        DO_ICALL                                         $64     
         99        CONCAT                                           ~65     ~63, $64
        100        CONCAT                                           ~66     ~65, '%26ReturnUrl%3D'
        101        INIT_FCALL                                               'urlencode'
        102        SEND_VAR                                                 !3
        103        DO_ICALL                                         $67     
        104        CONCAT                                           ~68     ~66, $67
        105        CONCAT                                           ~69     ~68, '%26CANCELURL%3D'
        106        INIT_FCALL                                               'urlencode'
        107        SEND_VAR                                                 !4
        108        DO_ICALL                                         $70     
        109        CONCAT                                           ~71     ~69, $70
        110        CONCAT                                           ~72     ~71, '%26CURRENCYCODE%3D'
        111        INIT_FCALL                                               'urlencode'
        112        SEND_VAR                                                 !6
        113        DO_ICALL                                         $73     
        114        CONCAT                                           ~74     ~72, $73
        115        ASSIGN                                                   !8, ~74
   39   116        FETCH_OBJ_R                                      ~76     '_header'
        117      > JMPZ                                                     ~76, ->124
        118    >   INIT_FCALL                                               'urlencode'
        119        FETCH_OBJ_R                                      ~77     '_header'
        120        SEND_VAL                                                 ~77
        121        DO_ICALL                                         $78     
        122        CONCAT                                           ~79     '%26HDRIMG%3D', $78
        123        ASSIGN_OP                                     8          !8, ~79
   45   124    >   FETCH_CONSTANT                                   ~81     '_PS_MODULE_DIR_'
        125        CONCAT                                           ~82     ~81, 'paypalapi%2Fapi%2FPaypalLib.php'
        126        INCLUDE_OR_EVAL                                          ~82, INCLUDE
   46   127        NEW                                              $84     'PaypalLib'
        128        DO_FCALL                                      0          
        129        ASSIGN                                                   !9, $84
   47   130        INIT_METHOD_CALL                                         !9, 'makeCall'
        131        INIT_METHOD_CALL                                         'getAPIURL'
        132        DO_FCALL                                      0  $87     
        133        SEND_VAR_NO_REF_EX                                       $87
        134        INIT_METHOD_CALL                                         'getAPIScript'
        135        DO_FCALL                                      0  $88     
        136        SEND_VAR_NO_REF_EX                                       $88
        137        SEND_VAL_EX                                              'SetExpressCheckout'
        138        SEND_VAR_EX                                              !8
        139        DO_FCALL                                      0  $89     
        140        ASSIGN                                                   !10, $89
   48   141        INIT_FCALL                                               'array_merge'
        142        FETCH_OBJ_R                                      ~92     '_logs'
        143        SEND_VAL                                                 ~92
        144        INIT_METHOD_CALL                                         !9, 'getLogs'
        145        DO_FCALL                                      0  $93     
        146        SEND_VAR                                                 $93
        147        DO_ICALL                                         $94     
        148        ASSIGN_OBJ                                               '_logs'
        149        OP_DATA                                                  $94
   49   150      > RETURN                                                   !10
   50   151*     > RETURN                                                   null

End of function getauthorisation

Function getcustomerinfos:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cDG1P
function name:  getCustomerInfos
number of ops:  36
compiled vars:  !0 = $cookie, !1 = $request, !2 = $ppAPI, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   BIND_GLOBAL                                              !0, 'cookie'
   57     1        INIT_FCALL                                               'urlencode'
          2        FETCH_OBJ_R                                      ~4      !0, 'paypal_token'
          3        CAST                                          6  ~5      ~4
          4        SEND_VAL                                                 ~5
          5        DO_ICALL                                         $6      
          6        CONCAT                                           ~7      '%26TOKEN%3D', $6
          7        ASSIGN                                                   !1, ~7
   60     8        FETCH_CONSTANT                                   ~9      '_PS_MODULE_DIR_'
          9        CONCAT                                           ~10     ~9, 'paypalapi%2Fapi%2FPaypalLib.php'
         10        INCLUDE_OR_EVAL                                          ~10, INCLUDE
   61    11        NEW                                              $12     'PaypalLib'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $12
   62    14        INIT_METHOD_CALL                                         !2, 'makeCall'
         15        INIT_METHOD_CALL                                         'getAPIURL'
         16        DO_FCALL                                      0  $15     
         17        SEND_VAR_NO_REF_EX                                       $15
         18        INIT_METHOD_CALL                                         'getAPIScript'
         19        DO_FCALL                                      0  $16     
         20        SEND_VAR_NO_REF_EX                                       $16
         21        SEND_VAL_EX                                              'GetExpressCheckoutDetails'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $17     
         24        ASSIGN                                                   !3, $17
   63    25        INIT_FCALL                                               'array_merge'
         26        FETCH_OBJ_R                                      ~20     '_logs'
         27        SEND_VAL                                                 ~20
         28        INIT_METHOD_CALL                                         !2, 'getLogs'
         29        DO_FCALL                                      0  $21     
         30        SEND_VAR                                                 $21
         31        DO_ICALL                                         $22     
         32        ASSIGN_OBJ                                               '_logs'
         33        OP_DATA                                                  $22
   64    34      > RETURN                                                   !3
   65    35*     > RETURN                                                   null

End of function getcustomerinfos

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

End of function getlogs

End of class PaypalExpress.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.25 ms | 1416 KiB | 21 Q