3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * OpenPayU * * @copyright Copyright (c) 2014 PayU * @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0) * * http://www.payu.com * http://developers.payu.com * http://twitter.com/openpayu * */ session_start(); var_dump($_SESSION['current_token']); require_once realpath(dirname(__FILE__)) . '/../../../lib/openpayu.php'; require_once realpath(dirname(__FILE__)) . '/../../config.php'; $currentToken = $_SESSION['current_token']; $order = array( 'customerIp' => '127.0.0.1', 'notifyUrl' => 'http://oskartestserver.net/examples/v2/order/Notify.php', 'merchantPosId' =>'185641', 'continueUrl' =>'http://oskartestserver.net/positive', 'description' => 'popis transakce', 'currencyCode' => 'CZK', 'totalAmount' => '999', 'buyer' => array( 'email' => 'email@exampledomain.com', 'firstName' => 'Jan', 'lastName' => 'Novak', 'delivery' => array( 'recipientName' => 'Jan Novak', 'countryCode' => 'CZ') ), 'products' => array( array('name' => 'Mouse', 'unitPrice' => '999', 'quantity' => '1') ), 'payMethods' => array( 'payMethod' => array( 'type' =>'CARD_TOKEN', 'value' => $currentToken) ), 'settings' => array( 'agreement' => 'true') ); ?> <!doctype html> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>Create Order - OpenPayU v2</title> <link rel="stylesheet" href="../../layout/css/bootstrap.min.css"> <link rel="stylesheet" href="../../layout/css/style.css"> </head> <body> <div class="container"> <div class="page-header"> <h1>Create Order - OpenPayU v2</h1> </div> <?php try { $response = OpenPayU_Order::create($order); $status_desc = OpenPayU_Util::statusDesc($response->getStatus()); if($response->getStatus() == 'SUCCESS'){ echo '<div class="alert alert-success">SUCCESS: '.$status_desc; echo '</div>'; }else{ echo '<div class="alert alert-warning">'.$response->getStatus().': '.$status_desc; echo '</div>'; } }catch (OpenPayU_Exception $e){ echo '<pre>'; var_dump((string)$e); echo '</pre>'; } ?> <h1>Request</h1> <div id="unregisteredCardData"> <?php var_dump($order); ?> </div> <table class="table table-hover table-bordered"> <thead> <tr> <th colspan="2">Important data from response</th> </tr> </thead> <tbody> <tr> <td>Order status</td> <td><?= $response->getStatus() ?></td> </tr> <tr> <td>Order id</td> <td><?= $response->getResponse()->orderId ?></td> <?php file_put_contents(__DIR__.'/orderID.log', $response->getResponse()->orderId); ?> </tr> <tr> <td>Redirect Uri</td> <td><a href="<?= $response->getResponse()->redirectUri ?>"><?= $response->getResponse()->redirectUri ?></a> </td> </tr> </tbody> </table> <h1>Response</h1> <div id="unregisteredCardData"> <?php var_dump($response); ?> </div> </div> </html>
Output for 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined array key "current_token" in /in/sW5uc on line 16 NULL Warning: require_once(): open_basedir restriction in effect. File(/in/../../../lib/openpayu.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/sW5uc on line 18 Warning: require_once(/in/../../../lib/openpayu.php): Failed to open stream: Operation not permitted in /in/sW5uc on line 18 Fatal error: Uncaught Error: Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc:18 Stack trace: #0 {main} thrown in /in/sW5uc on line 18
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Warning: Undefined array key "current_token" in /in/sW5uc on line 16 NULL Warning: require_once(/in/../../../lib/openpayu.php): Failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: Uncaught Error: Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc:18 Stack trace: #0 {main} thrown in /in/sW5uc on line 18
Process exited with code 255.
Output for 7.4.33
Notice: Undefined index: current_token in /in/sW5uc on line 16 NULL Warning: require_once(/in/../../../lib/openpayu.php): failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: require_once(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 7.4.26 - 7.4.32
Notice: Undefined index: current_token in /in/sW5uc on line 16 NULL Warning: require_once(): open_basedir restriction in effect. File(/in/../../../lib/openpayu.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/sW5uc on line 18 Warning: require_once(/in/../../../lib/openpayu.php): failed to open stream: Operation not permitted in /in/sW5uc on line 18 Fatal error: require_once(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25
NULL Warning: require_once(/in/../../../lib/openpayu.php): failed to open stream: No such file or directory in /in/sW5uc on line 18 Fatal error: require_once(): Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in /in/sW5uc on line 18
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/sW5uc</b> on line <b>14</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/sW5uc:14) in <b>/in/sW5uc</b> on line <b>14</b><br /> NULL <br /> <b>Warning</b>: require_once(/in/../../../lib/openpayu.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/in/sW5uc</b> on line <b>18</b><br /> <br /> <b>Fatal error</b>: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in <b>/in/sW5uc</b> on line <b>18</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/sW5uc</b> on line <b>14</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/sW5uc:14) in <b>/in/sW5uc</b> on line <b>14</b><br /> NULL <br /> <b>Warning</b>: main(/in/../../../lib/openpayu.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in <b>/in/sW5uc</b> on line <b>18</b><br /> <br /> <b>Fatal error</b>: main() [<a href='function.require'>function.require</a>]: Failed opening required '/in/../../../lib/openpayu.php' (include_path='.:') in <b>/in/sW5uc</b> on line <b>18</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected '{' in <b>/in/sW5uc</b> on line <b>69</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected '{' in <b>/in/sW5uc</b> on line <b>69</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/sW5uc</b> on line <b>69</b><br />
Process exited with code 255.

preferences:
324.77 ms | 401 KiB | 468 Q