3v4l.org

run code in 300+ PHP versions simultaneously
<?php require 'vendor/autoload.php'; \Stripe\Stripe::setApiKey('d64d96fea91a8787792e'); try { $customer = \Stripe\Customer::create([ 'email' => 'customer@example.com', 'name' => 'John Doe', 'source' => 'tok_visa' ]); $charge = \Stripe\Charge::create([ 'amount' => 1000, 'currency' => 'jpy', 'customer' => $customer->id, 'description' => 'Example charge' ]); echo "Charge successful! Charge ID: " . $charge->id; echo "Customer ID: " . $customer->id; } catch (\Stripe\Exception\ApiErrorException $e) { echo "Error: " . $e->getError()->message; } catch (Exception $e) { echo "Error: " . $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 24
Branch analysis from position: 24
2 jumps found. (Code = 107) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 31
2 jumps found. (Code = 107) Position 1 = 32, Position 2 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 31
Branch analysis from position: 31
filename:       /in/sISpb
function name:  (null)
number of ops:  37
compiled vars:  !0 = $customer, !1 = $charge, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'vendor%2Fautoload.php', REQUIRE
    4     1        INIT_STATIC_METHOD_CALL                                  'Stripe%5CStripe', 'setApiKey'
          2        SEND_VAL_EX                                              'd64d96fea91a8787792e'
          3        DO_FCALL                                      0          
    7     4        INIT_STATIC_METHOD_CALL                                  'Stripe%5CCustomer', 'create'
    8     5        SEND_VAL_EX                                              <array>
    7     6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !0, $5
   13     8        INIT_STATIC_METHOD_CALL                                  'Stripe%5CCharge', 'create'
   14     9        INIT_ARRAY                                       ~7      1000, 'amount'
   15    10        ADD_ARRAY_ELEMENT                                ~7      'jpy', 'currency'
   16    11        FETCH_OBJ_R                                      ~8      !0, 'id'
         12        ADD_ARRAY_ELEMENT                                ~7      ~8, 'customer'
   17    13        ADD_ARRAY_ELEMENT                                ~7      'Example+charge', 'description'
         14        SEND_VAL_EX                                              ~7
   13    15        DO_FCALL                                      0  $9      
         16        ASSIGN                                                   !1, $9
   20    17        FETCH_OBJ_R                                      ~11     !1, 'id'
         18        CONCAT                                           ~12     'Charge+successful%21+Charge+ID%3A+', ~11
         19        ECHO                                                     ~12
   21    20        FETCH_OBJ_R                                      ~13     !0, 'id'
         21        CONCAT                                           ~14     'Customer+ID%3A+', ~13
         22        ECHO                                                     ~14
         23      > JMP                                                      ->36
   23    24  E > > CATCH                                                    'Stripe%5CException%5CApiErrorException', ->31
   24    25    >   INIT_METHOD_CALL                                         !2, 'getError'
         26        DO_FCALL                                      0  $15     
         27        FETCH_OBJ_R                                      ~16     $15, 'message'
         28        CONCAT                                           ~17     'Error%3A+', ~16
         29        ECHO                                                     ~17
         30      > JMP                                                      ->36
   25    31  E > > CATCH                                       last         'Exception'
   26    32    >   INIT_METHOD_CALL                                         !2, 'getMessage'
         33        DO_FCALL                                      0  $18     
         34        CONCAT                                           ~19     'Error%3A+', $18
         35        ECHO                                                     ~19
   27    36    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.25 ms | 968 KiB | 13 Q