3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data['vendor_id'] = 415; $data['vendor_auth_code'] = '4205:42e7aaa88b48137a16a1acd04ed9112520dd4dd5865055a091a6e8548220aca3'; $data['product_id'] = '493518'; $data['webhook_url'] = 'http://mysite.com/callback'; // URL to call when product is purchased // You must provide at least one price for the checkout, here we are setting multiple for different currencies. $data['prices'] = ['USD:4.99']; $data['expires'] = '2015-09-20'; // YYYY-MM-DD // This is where we specify the other participants that we wish to split earnings with $data['affiliates'] = [ '11740:0.30', // Vendor 11740 gets 30% ]; // You (requester) gets 70% // Here we make the request to the Paddle API $url = 'https://vendors.paddle.com/api/2.0/product/generate_pay_link'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $response = curl_exec($ch); // And handle the response... $data = json_decode($response); if($data->success) { echo "Success! Checkout URL:".$data->response->url; } else { echo "Your request failed with error: ".$data->error->message; } ?>
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/i8rFF:15 Stack trace: #0 {main} thrown in /in/i8rFF on line 15
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/i8rFF on line 15
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/i8rFF on line 7
Process exited with code 255.