3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint); $transaction = [ 'Customer' => [ 'Reference' => 'A12345', 'Title' => 'Mr.', 'FirstName' => 'John', 'LastName' => 'Smith', 'CompanyName' => 'Demo Shop 123', 'JobDescription' => 'Developer', 'Street1' => 'Level 5', 'Street2' => '369 Queen Street', 'City' => 'Sydney', 'State' => 'NSW', 'PostalCode' => '2000', 'Country' => 'au', 'Phone' => '09 889 0986', 'Mobile' => '09 889 6542', 'Email' => 'demo@example.org', "Url" => "http://www.ewaypayments.com", 'CardDetails' => [ 'Name' => 'John Smith', 'Number' => '4444333322221111', 'ExpiryMonth' => '12', 'ExpiryYear' => '25', 'CVN' => '123', ] ], 'ShippingAddress' => [ 'ShippingMethod' => \Eway\Rapid\Enum\ShippingMethod::NEXT_DAY, 'FirstName' => 'John', 'LastName' => 'Smith', 'Street1' => 'Level 5', 'Street2' => '369 Queen Street', 'City' => 'Sydney', 'State' => 'NSW', 'Country' => 'au', 'PostalCode' => '2000', 'Phone' => '09 889 0986', ], 'Items' => [ [ 'SKU' => '12345678901234567890', 'Description' => 'Item Description 1', 'Quantity' => 1, 'UnitCost' => 400, 'Tax' => 100, // Total is calculated automatically ], [ 'SKU' => '123456789012', 'Description' => 'Item Description 2', 'Quantity' => 1, 'UnitCost' => 400, 'Tax' => 100, ], ], 'Options' => [ [ 'Value' => 'Option1', ], [ 'Value' => 'Option2', ], ], 'Payment' => [ 'TotalAmount' => 1000, 'InvoiceNumber' => 'Inv 21540', 'InvoiceDescription' => 'Individual Invoice Description', 'InvoiceReference' => '513456', 'CurrencyCode' => 'AUD', ], 'DeviceID' => 'D1234', 'CustomerIP' => '127.0.0.1', 'PartnerID' => 'ID', 'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE, 'Capture' => true, ]; $response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction);
based on rfH3G
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'Eway\Rapid' not found in /in/CDet7:3 Stack trace: #0 {main} thrown in /in/CDet7 on line 3
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Class 'Eway\Rapid' not found in /in/CDet7 on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/CDet7 on line 5
Process exited with code 255.