3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?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; } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.6.150.0100.07018.28
5.6.140.0030.03718.15
5.6.130.0130.08718.15
5.6.120.0030.05021.12
5.6.110.0070.08721.07
5.6.100.0030.07720.98
5.6.90.0130.07721.09
5.6.80.0130.03320.48
5.5.300.0100.06318.04
5.5.290.0100.08317.92
5.5.280.0230.05020.96
5.5.270.0170.07020.78
5.5.260.0170.07720.86
5.5.250.0170.07020.77
5.5.240.0170.06320.23

preferences:
140.42 ms | 1394 KiB | 7 Q