3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Stripe; class Stripe{ protected $apiKey; protected $apiBase = 'https://api.stripe.com'; protected $apiUploadBase = 'https://uploads.stripe.com'; protected $version = '1.0.0'; protected $apiVersion = null; /* @return string API key */ public function getApiKey(){ return $this->apiKey; } /* @param $apiKey * Sets API Key for requests */ public function setApiKey($apiKey){ $this->apiKey = $apiKey; return $this; } /* @return string * return library version */ protected function getVersion(){ return $this->version; } /* * @return string * returns API version for requests; Null if not set. */ protected function getApiVersion(){ return $this->apiVersion; } /* * @param $version * Set API version for requests */ public function setApiVersion($version){ $this->apiVersion = $version; return $this; } } $stripe = new Stripe; $stripe->setApiKey('abc123')->setApiVersion('apiVersion'); $apikey = $stripe->getApiKey(); $apivers = $stripe->getApiVersion(); echo $apikey . PHP_EOL; echo $apivers . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVirk
function name:  (null)
number of ops:  22
compiled vars:  !0 = $stripe, !1 = $apikey, !2 = $apivers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   NEW                                              $3      'Stripe%5CStripe'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   57     3        INIT_METHOD_CALL                                         !0, 'setApiKey'
          4        SEND_VAL_EX                                              'abc123'
          5        DO_FCALL                                      0  $6      
          6        INIT_METHOD_CALL                                         $6, 'setApiVersion'
          7        SEND_VAL_EX                                              'apiVersion'
          8        DO_FCALL                                      0          
   59     9        INIT_METHOD_CALL                                         !0, 'getApiKey'
         10        DO_FCALL                                      0  $8      
         11        ASSIGN                                                   !1, $8
   60    12        INIT_METHOD_CALL                                         !0, 'getApiVersion'
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !2, $10
   62    15        FETCH_CONSTANT                                   ~12     'Stripe%5CPHP_EOL'
         16        CONCAT                                           ~13     !1, ~12
         17        ECHO                                                     ~13
   63    18        FETCH_CONSTANT                                   ~14     'Stripe%5CPHP_EOL'
         19        CONCAT                                           ~15     !2, ~14
         20        ECHO                                                     ~15
         21      > RETURN                                                   1

Class Stripe\Stripe:
Function getapikey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVirk
function name:  getApiKey
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'apiKey'
          1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function getapikey

Function setapikey:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVirk
function name:  setApiKey
number of ops:  6
compiled vars:  !0 = $apiKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        ASSIGN_OBJ                                               'apiKey'
          2        OP_DATA                                                  !0
   27     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   28     5*     > RETURN                                                   null

End of function setapikey

Function getversion:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVirk
function name:  getVersion
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   FETCH_OBJ_R                                      ~0      'version'
          1      > RETURN                                                   ~0
   35     2*     > RETURN                                                   null

End of function getversion

Function getapiversion:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVirk
function name:  getApiVersion
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   FETCH_OBJ_R                                      ~0      'apiVersion'
          1      > RETURN                                                   ~0
   43     2*     > RETURN                                                   null

End of function getapiversion

Function setapiversion:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVirk
function name:  setApiVersion
number of ops:  6
compiled vars:  !0 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV                                             !0      
   51     1        ASSIGN_OBJ                                               'apiVersion'
          2        OP_DATA                                                  !0
   52     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   53     5*     > RETURN                                                   null

End of function setapiversion

End of class Stripe\Stripe.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.29 ms | 1399 KiB | 13 Q