3v4l.org

run code in 300+ PHP versions simultaneously
<?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; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 55
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i8rFF
function name:  (null)
number of ops:  60
compiled vars:  !0 = $data, !1 = $url, !2 = $ch, !3 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 'vendor_id'
          1        OP_DATA                                                  415
    3     2        ASSIGN_DIM                                               !0, 'vendor_auth_code'
          3        OP_DATA                                                  '4205%3A42e7aaa88b48137a16a1acd04ed9112520dd4dd5865055a091a6e8548220aca3'
    4     4        ASSIGN_DIM                                               !0, 'product_id'
          5        OP_DATA                                                  '493518'
    5     6        ASSIGN_DIM                                               !0, 'webhook_url'
          7        OP_DATA                                                  'http%3A%2F%2Fmysite.com%2Fcallback'
    7     8        ASSIGN_DIM                                               !0, 'prices'
          9        OP_DATA                                                  <array>
    8    10        ASSIGN_DIM                                               !0, 'expires'
         11        OP_DATA                                                  '2015-09-20'
   10    12        ASSIGN_DIM                                               !0, 'affiliates'
   11    13        OP_DATA                                                  <array>
   14    14        ASSIGN                                                   !1, 'https%3A%2F%2Fvendors.paddle.com%2Fapi%2F2.0%2Fproduct%2Fgenerate_pay_link'
   15    15        INIT_FCALL_BY_NAME                                       'curl_init'
         16        SEND_VAR_EX                                              !1
         17        DO_FCALL                                      0  $12     
         18        ASSIGN                                                   !2, $12
   16    19        INIT_FCALL_BY_NAME                                       'curl_setopt'
         20        SEND_VAR_EX                                              !2
         21        FETCH_CONSTANT                                   ~14     'CURLOPT_POST'
         22        SEND_VAL_EX                                              ~14
         23        SEND_VAL_EX                                              <true>
         24        DO_FCALL                                      0          
   17    25        INIT_FCALL_BY_NAME                                       'curl_setopt'
         26        SEND_VAR_EX                                              !2
         27        FETCH_CONSTANT                                   ~16     'CURLOPT_RETURNTRANSFER'
         28        SEND_VAL_EX                                              ~16
         29        SEND_VAL_EX                                              <true>
         30        DO_FCALL                                      0          
   18    31        INIT_FCALL_BY_NAME                                       'curl_setopt'
         32        SEND_VAR_EX                                              !2
         33        FETCH_CONSTANT                                   ~18     'CURLOPT_POSTFIELDS'
         34        SEND_VAL_EX                                              ~18
         35        INIT_FCALL                                               'http_build_query'
         36        SEND_VAR                                                 !0
         37        DO_ICALL                                         $19     
         38        SEND_VAR_NO_REF_EX                                       $19
         39        DO_FCALL                                      0          
   19    40        INIT_FCALL_BY_NAME                                       'curl_exec'
         41        SEND_VAR_EX                                              !2
         42        DO_FCALL                                      0  $21     
         43        ASSIGN                                                   !3, $21
   21    44        INIT_FCALL                                               'json_decode'
         45        SEND_VAR                                                 !3
         46        DO_ICALL                                         $23     
         47        ASSIGN                                                   !0, $23
   22    48        FETCH_OBJ_R                                      ~25     !0, 'success'
         49      > JMPZ                                                     ~25, ->55
   23    50    >   FETCH_OBJ_R                                      ~26     !0, 'response'
         51        FETCH_OBJ_R                                      ~27     ~26, 'url'
         52        CONCAT                                           ~28     'Success%21+Checkout+URL%3A', ~27
         53        ECHO                                                     ~28
         54      > JMP                                                      ->59
   25    55    >   FETCH_OBJ_R                                      ~29     !0, 'error'
         56        FETCH_OBJ_R                                      ~30     ~29, 'message'
         57        CONCAT                                           ~31     'Your+request+failed+with+error%3A+', ~30
         58        ECHO                                                     ~31
   27    59    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.97 ms | 1392 KiB | 17 Q