3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Twitter-API-PHP : Simple PHP wrapper for the v1.1 API * * PHP version 5.3.10 * * @category Awesomeness * @package Twitter-API-PHP * @author James Mallison <me@j7mbo.co.uk> * @license MIT License * @link http://github.com/j7mbo/twitter-api-php */ class TwitterAPIExchange { private $oauth_access_token; private $oauth_access_token_secret; private $consumer_key; private $consumer_secret; private $postfields; private $getfield; protected $oauth; public $url; /** * Create the API access object. Requires an array of settings:: * oauth access token, oauth access token secret, consumer key, consumer secret * These are all available by creating your own application on dev.twitter.com * Requires the cURL library * * @param array $settings */ public function __construct(array $settings) { if (!in_array('curl', get_loaded_extensions())) { throw new Exception('You need to install cURL, see: http://curl.haxx.se/docs/install.html'); } if (!isset($settings['oauth_access_token']) || !isset($settings['oauth_access_token_secret']) || !isset($settings['consumer_key']) || !isset($settings['consumer_secret'])) { throw new Exception('Make sure you are passing in the correct parameters'); } $this->oauth_access_token = $settings['oauth_access_token']; $this->oauth_access_token_secret = $settings['oauth_access_token_secret']; $this->consumer_key = $settings['consumer_key']; $this->consumer_secret = $settings['consumer_secret']; } /** * Set postfields array, example: array('screen_name' => 'J7mbo') * * @param array $array Array of parameters to send to API * * @return TwitterAPIExchange Instance of self for method chaining */ public function setPostfields(array $array) { if (!is_null($this->getGetfield())) { throw new Exception('You can only choose get OR post fields.'); } if (isset($array['status']) && substr($array['status'], 0, 1) === '@') { $array['status'] = sprintf("\0%s", $array['status']); } $this->postfields = $array; return $this; } /** * Set getfield string, example: '?screen_name=J7mbo' * * @param string $string Get key and value pairs as string * * @return \TwitterAPIExchange Instance of self for method chaining */ public function setGetfield($string) { if (!is_null($this->getPostfields())) { throw new Exception('You can only choose get OR post fields.'); } $search = array('#', ',', '+', ':'); $replace = array('%23', '%2C', '%2B', '%3A'); $string = str_replace($search, $replace, $string); $this->getfield = $string; return $this; } /** * Get getfield string (simple getter) * * @return string $this->getfields */ public function getGetfield() { return $this->getfield; } /** * Get postfields array (simple getter) * * @return array $this->postfields */ public function getPostfields() { return $this->postfields; } /** * Build the Oauth object using params set in construct and additionals * passed to this method. For v1.1, see: https://dev.twitter.com/docs/api/1.1 * * @param string $url The API url to use. Example: https://api.twitter.com/1.1/search/tweets.json * @param string $requestMethod Either POST or GET * @return \TwitterAPIExchange Instance of self for method chaining */ public function buildOauth($url, $requestMethod) { if (!in_array(strtolower($requestMethod), array('post', 'get'))) { throw new Exception('Request method must be either POST or GET'); } $consumer_key = $this->consumer_key; $consumer_secret = $this->consumer_secret; $oauth_access_token = $this->oauth_access_token; $oauth_access_token_secret = $this->oauth_access_token_secret; $oauth = array( 'oauth_consumer_key' => $consumer_key, 'oauth_nonce' => time(), 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_token' => $oauth_access_token, 'oauth_timestamp' => time(), 'oauth_version' => '1.0' ); $getfield = $this->getGetfield(); if (!is_null($getfield)) { $getfields = str_replace('?', '', explode('&', $getfield)); foreach ($getfields as $g) { $split = explode('=', $g); $oauth[$split[0]] = $split[1]; } } $base_info = $this->buildBaseString($url, $requestMethod, $oauth); $composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret); $oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true)); $oauth['oauth_signature'] = $oauth_signature; $this->url = $url; $this->oauth = $oauth; return $this; } /** * Perform the actual data retrieval from the API * * @param boolean $return If true, returns data. * * @return string json If $return param is true, returns json data. */ public function performRequest($return = true) { if (!is_bool($return)) { throw new Exception('performRequest parameter must be true or false'); } $header = array($this->buildAuthorizationHeader($this->oauth), 'Expect:'); $getfield = $this->getGetfield(); $postfields = $this->getPostfields(); $options = array( CURLOPT_HTTPHEADER => $header, CURLOPT_HEADER => false, CURLOPT_URL => $this->url, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, ); if (!is_null($postfields)) { $options[CURLOPT_POSTFIELDS] = $postfields; } else { if ($getfield !== '') { $options[CURLOPT_URL] .= $getfield; } } $feed = curl_init(); curl_setopt_array($feed, $options); $json = curl_exec($feed); curl_close($feed); if ($return) { return $json; } } /** * Private method to generate the base string used by cURL * * @param string $baseURI * @param string $method * @param array $params * * @return string Built base string */ private function buildBaseString($baseURI, $method, $params) { $return = array(); ksort($params); foreach($params as $key=>$value) { $return[] = "$key=" . $value; } return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $return)); } /** * Private method to generate authorization header used by cURL * * @param array $oauth Array of oauth data generated by buildOauth() * * @return string $return Header used by cURL for request */ private function buildAuthorizationHeader($oauth) { $return = 'Authorization: OAuth '; $values = array(); foreach($oauth as $key => $value) { $values[] = "$key=\"" . rawurlencode($value) . "\""; } $return .= implode(', ', $values); return $return; } } class Tweet extends TwitterAPIExchange { //Enter your details here const oauth_token = "16127841-XhE5Xlw8bArFmSyouf4y9AHx9KUJ2SrpL95994QV0"; const oauth_secret = "wtmbZlSntIXpKqiq4mIDmY1JqqmsIP6FCy1UyHRI9DuJ6"; const consumer_key = "hccV6YwzcYC9bjaTnbC6W6h2D"; const consumer_secret = "OucJEZ0GR6PgGSHZje0DLSmGdSmyXx9b0CWiSGVwla1jzApSdM"; public $json; public $get; private $twitter; public function __construct() { $settings = array('oauth_access_token' => self::oauth_token, 'oauth_access_token_secret' => self::oauth_secret, 'consumer_key' => self::consumer_key, 'consumer_secret' => self::consumer_secret); $this->twitter = new TwitterAPIExchange($settings); return $this; } public function set($json, $get) { $this->json = "https://api.twitter.com/1.1/".$json.".json"; if(is_array($get)) { $this->get = http_build_query($get); } else { $this->get = $get; } return $this; } public function call() { $response=$this->twitter->setGetfield("?".$this->get) ->buildOauth($this->json, "GET") ->performRequest(); $response=json_decode($response, true); return (array) $response; } } echo (new Tweet)->set("users/show", array("screen_name"=>$user))->call(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FhStI
function name:  (null)
number of ops:  11
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  305     0  E >   NEW                                              $1      'Tweet'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'set'
          3        SEND_VAL_EX                                              'users%2Fshow'
          4        INIT_ARRAY                                       ~3      !0, 'screen_name'
          5        SEND_VAL_EX                                              ~3
          6        DO_FCALL                                      0  $4      
          7        INIT_METHOD_CALL                                         $4, 'call'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
  306    10      > RETURN                                                   1

Class TwitterAPIExchange:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 47) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 47) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 23
Branch analysis from position: 19
filename:       /in/FhStI
function name:  __construct
number of ops:  45
compiled vars:  !0 = $settings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        INIT_FCALL                                               'in_array'
          2        SEND_VAL                                                 'curl'
          3        INIT_FCALL                                               'get_loaded_extensions'
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7        BOOL_NOT                                         ~3      $2
          8      > JMPZ                                                     ~3, ->13
   36     9    >   NEW                                              $4      'Exception'
         10        SEND_VAL_EX                                              'You+need+to+install+cURL%2C+see%3A+http%3A%2F%2Fcurl.haxx.se%2Fdocs%2Finstall.html'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $4
   39    13    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'oauth_access_token'
         14        BOOL_NOT                                         ~7      ~6
         15      > JMPNZ_EX                                         ~7      ~7, ->19
   40    16    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~8      !0, 'oauth_access_token_secret'
         17        BOOL_NOT                                         ~9      ~8
         18        BOOL                                             ~7      ~9
         19    > > JMPNZ_EX                                         ~7      ~7, ->23
   41    20    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !0, 'consumer_key'
         21        BOOL_NOT                                         ~11     ~10
         22        BOOL                                             ~7      ~11
         23    > > JMPNZ_EX                                         ~7      ~7, ->27
   42    24    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !0, 'consumer_secret'
         25        BOOL_NOT                                         ~13     ~12
         26        BOOL                                             ~7      ~13
         27    > > JMPZ                                                     ~7, ->32
   44    28    >   NEW                                              $14     'Exception'
         29        SEND_VAL_EX                                              'Make+sure+you+are+passing+in+the+correct+parameters'
         30        DO_FCALL                                      0          
         31      > THROW                                         0          $14
   47    32    >   FETCH_DIM_R                                      ~17     !0, 'oauth_access_token'
         33        ASSIGN_OBJ                                               'oauth_access_token'
         34        OP_DATA                                                  ~17
   48    35        FETCH_DIM_R                                      ~19     !0, 'oauth_access_token_secret'
         36        ASSIGN_OBJ                                               'oauth_access_token_secret'
         37        OP_DATA                                                  ~19
   49    38        FETCH_DIM_R                                      ~21     !0, 'consumer_key'
         39        ASSIGN_OBJ                                               'consumer_key'
         40        OP_DATA                                                  ~21
   50    41        FETCH_DIM_R                                      ~23     !0, 'consumer_secret'
         42        ASSIGN_OBJ                                               'consumer_secret'
         43        OP_DATA                                                  ~23
   51    44      > RETURN                                                   null

End of function __construct

Function setpostfields:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 20
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 20
filename:       /in/FhStI
function name:  setPostfields
number of ops:  33
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   60     0  E >   RECV                                             !0      
   62     1        INIT_METHOD_CALL                                         'getGetfield'
          2        DO_FCALL                                      0  $1      
          3        TYPE_CHECK                                    2  ~2      $1
          4        BOOL_NOT                                         ~3      ~2
          5      > JMPZ                                                     ~3, ->10
   64     6    >   NEW                                              $4      'Exception'
          7        SEND_VAL_EX                                              'You+can+only+choose+get+OR+post+fields.'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $4
   67    10    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'status'
         11      > JMPZ_EX                                          ~6      ~6, ->20
         12    >   INIT_FCALL                                               'substr'
         13        FETCH_DIM_R                                      ~7      !0, 'status'
         14        SEND_VAL                                                 ~7
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $8      
         18        IS_IDENTICAL                                     ~9      $8, '%40'
         19        BOOL                                             ~6      ~9
         20    > > JMPZ                                                     ~6, ->28
   69    21    >   INIT_FCALL                                               'sprintf'
         22        SEND_VAL                                                 '%00%25s'
         23        FETCH_DIM_R                                      ~11     !0, 'status'
         24        SEND_VAL                                                 ~11
         25        DO_ICALL                                         $12     
         26        ASSIGN_DIM                                               !0, 'status'
         27        OP_DATA                                                  $12
   72    28    >   ASSIGN_OBJ                                               'postfields'
         29        OP_DATA                                                  !0
   74    30        FETCH_THIS                                       ~14     
         31      > RETURN                                                   ~14
   75    32*     > RETURN                                                   null

End of function setpostfields

Function setgetfield:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FhStI
function name:  setGetfield
number of ops:  23
compiled vars:  !0 = $string, !1 = $search, !2 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   84     0  E >   RECV                                             !0      
   86     1        INIT_METHOD_CALL                                         'getPostfields'
          2        DO_FCALL                                      0  $3      
          3        TYPE_CHECK                                    2  ~4      $3
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->10
   88     6    >   NEW                                              $6      'Exception'
          7        SEND_VAL_EX                                              'You+can+only+choose+get+OR+post+fields.'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $6
   91    10    >   ASSIGN                                                   !1, <array>
   92    11        ASSIGN                                                   !2, <array>
   93    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !0, $10
   95    18        ASSIGN_OBJ                                               'getfield'
         19        OP_DATA                                                  !0
   97    20        FETCH_THIS                                       ~13     
         21      > RETURN                                                   ~13
   98    22*     > RETURN                                                   null

End of function setgetfield

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

End of function getgetfield

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

End of function getpostfields

Function buildoauth:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 60
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 48, Position 2 = 59
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 59
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 60
filename:       /in/FhStI
function name:  buildOauth
number of ops:  94
compiled vars:  !0 = $url, !1 = $requestMethod, !2 = $consumer_key, !3 = $consumer_secret, !4 = $oauth_access_token, !5 = $oauth_access_token_secret, !6 = $oauth, !7 = $getfield, !8 = $getfields, !9 = $g, !10 = $split, !11 = $base_info, !12 = $composite_key, !13 = $oauth_signature
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  128     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  130     2        INIT_FCALL                                               'strtolower'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $14     
          5        IN_ARRAY                                         ~15     $14, <array>
          6        BOOL_NOT                                         ~16     ~15
          7      > JMPZ                                                     ~16, ->12
  132     8    >   NEW                                              $17     'Exception'
          9        SEND_VAL_EX                                              'Request+method+must+be+either+POST+or+GET'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $17
  135    12    >   FETCH_OBJ_R                                      ~19     'consumer_key'
         13        ASSIGN                                                   !2, ~19
  136    14        FETCH_OBJ_R                                      ~21     'consumer_secret'
         15        ASSIGN                                                   !3, ~21
  137    16        FETCH_OBJ_R                                      ~23     'oauth_access_token'
         17        ASSIGN                                                   !4, ~23
  138    18        FETCH_OBJ_R                                      ~25     'oauth_access_token_secret'
         19        ASSIGN                                                   !5, ~25
  141    20        INIT_ARRAY                                       ~27     !2, 'oauth_consumer_key'
  142    21        INIT_FCALL                                               'time'
         22        DO_ICALL                                         $28     
         23        ADD_ARRAY_ELEMENT                                ~27     $28, 'oauth_nonce'
  143    24        ADD_ARRAY_ELEMENT                                ~27     'HMAC-SHA1', 'oauth_signature_method'
  144    25        ADD_ARRAY_ELEMENT                                ~27     !4, 'oauth_token'
  145    26        INIT_FCALL                                               'time'
         27        DO_ICALL                                         $29     
         28        ADD_ARRAY_ELEMENT                                ~27     $29, 'oauth_timestamp'
  146    29        ADD_ARRAY_ELEMENT                                ~27     '1.0', 'oauth_version'
  140    30        ASSIGN                                                   !6, ~27
  149    31        INIT_METHOD_CALL                                         'getGetfield'
         32        DO_FCALL                                      0  $31     
         33        ASSIGN                                                   !7, $31
  151    34        TYPE_CHECK                                    2  ~33     !7
         35        BOOL_NOT                                         ~34     ~33
         36      > JMPZ                                                     ~34, ->60
  153    37    >   INIT_FCALL                                               'str_replace'
         38        SEND_VAL                                                 '%3F'
         39        SEND_VAL                                                 ''
         40        INIT_FCALL                                               'explode'
         41        SEND_VAL                                                 '%26'
         42        SEND_VAR                                                 !7
         43        DO_ICALL                                         $35     
         44        SEND_VAR                                                 $35
         45        DO_ICALL                                         $36     
         46        ASSIGN                                                   !8, $36
  154    47      > FE_RESET_R                                       $38     !8, ->59
         48    > > FE_FETCH_R                                               $38, !9, ->59
  156    49    >   INIT_FCALL                                               'explode'
         50        SEND_VAL                                                 '%3D'
         51        SEND_VAR                                                 !9
         52        DO_ICALL                                         $39     
         53        ASSIGN                                                   !10, $39
  157    54        FETCH_DIM_R                                      ~41     !10, 0
         55        FETCH_DIM_R                                      ~43     !10, 1
         56        ASSIGN_DIM                                               !6, ~41
         57        OP_DATA                                                  ~43
  154    58      > JMP                                                      ->48
         59    >   FE_FREE                                                  $38
  161    60    >   INIT_METHOD_CALL                                         'buildBaseString'
         61        SEND_VAR_EX                                              !0
         62        SEND_VAR_EX                                              !1
         63        SEND_VAR_EX                                              !6
         64        DO_FCALL                                      0  $44     
         65        ASSIGN                                                   !11, $44
  162    66        INIT_FCALL                                               'rawurlencode'
         67        SEND_VAR                                                 !3
         68        DO_ICALL                                         $46     
         69        CONCAT                                           ~47     $46, '%26'
         70        INIT_FCALL                                               'rawurlencode'
         71        SEND_VAR                                                 !5
         72        DO_ICALL                                         $48     
         73        CONCAT                                           ~49     ~47, $48
         74        ASSIGN                                                   !12, ~49
  163    75        INIT_FCALL                                               'base64_encode'
         76        INIT_FCALL                                               'hash_hmac'
         77        SEND_VAL                                                 'sha1'
         78        SEND_VAR                                                 !11
         79        SEND_VAR                                                 !12
         80        SEND_VAL                                                 <true>
         81        DO_ICALL                                         $51     
         82        SEND_VAR                                                 $51
         83        DO_ICALL                                         $52     
         84        ASSIGN                                                   !13, $52
  164    85        ASSIGN_DIM                                               !6, 'oauth_signature'
         86        OP_DATA                                                  !13
  166    87        ASSIGN_OBJ                                               'url'
         88        OP_DATA                                                  !0
  167    89        ASSIGN_OBJ                                               'oauth'
         90        OP_DATA                                                  !6
  169    91        FETCH_THIS                                       ~57     
         92      > RETURN                                                   ~57
  170    93*     > RETURN                                                   null

End of function buildoauth

Function performrequest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
Branch analysis from position: 62
Branch analysis from position: 46
filename:       /in/FhStI
function name:  performRequest
number of ops:  63
compiled vars:  !0 = $return, !1 = $header, !2 = $getfield, !3 = $postfields, !4 = $options, !5 = $feed, !6 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  179     0  E >   RECV_INIT                                        !0      <true>
  181     1        TYPE_CHECK                                   12  ~7      !0
          2        BOOL_NOT                                         ~8      ~7
          3      > JMPZ                                                     ~8, ->8
  183     4    >   NEW                                              $9      'Exception'
          5        SEND_VAL_EX                                              'performRequest+parameter+must+be+true+or+false'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $9
  186     8    >   INIT_METHOD_CALL                                         'buildAuthorizationHeader'
          9        CHECK_FUNC_ARG                                           
         10        FETCH_OBJ_FUNC_ARG                               $11     'oauth'
         11        SEND_FUNC_ARG                                            $11
         12        DO_FCALL                                      0  $12     
         13        INIT_ARRAY                                       ~13     $12
         14        ADD_ARRAY_ELEMENT                                ~13     'Expect%3A'
         15        ASSIGN                                                   !1, ~13
  188    16        INIT_METHOD_CALL                                         'getGetfield'
         17        DO_FCALL                                      0  $15     
         18        ASSIGN                                                   !2, $15
  189    19        INIT_METHOD_CALL                                         'getPostfields'
         20        DO_FCALL                                      0  $17     
         21        ASSIGN                                                   !3, $17
  192    22        FETCH_CONSTANT                                   ~19     'CURLOPT_HTTPHEADER'
         23        INIT_ARRAY                                       ~20     !1, ~19
  193    24        FETCH_CONSTANT                                   ~21     'CURLOPT_HEADER'
  192    25        ADD_ARRAY_ELEMENT                                ~20     <false>, ~21
  194    26        FETCH_CONSTANT                                   ~22     'CURLOPT_URL'
         27        FETCH_OBJ_R                                      ~23     'url'
         28        ADD_ARRAY_ELEMENT                                ~20     ~23, ~22
  195    29        FETCH_CONSTANT                                   ~24     'CURLOPT_RETURNTRANSFER'
  192    30        ADD_ARRAY_ELEMENT                                ~20     <true>, ~24
  196    31        FETCH_CONSTANT                                   ~25     'CURLOPT_TIMEOUT'
         32        ADD_ARRAY_ELEMENT                                ~20     10, ~25
  191    33        ASSIGN                                                   !4, ~20
  199    34        TYPE_CHECK                                    2  ~27     !3
         35        BOOL_NOT                                         ~28     ~27
         36      > JMPZ                                                     ~28, ->41
  201    37    >   FETCH_CONSTANT                                   ~29     'CURLOPT_POSTFIELDS'
         38        ASSIGN_DIM                                               !4, ~29
         39        OP_DATA                                                  !3
         40      > JMP                                                      ->46
  205    41    >   IS_NOT_IDENTICAL                                         !2, ''
         42      > JMPZ                                                     ~31, ->46
  207    43    >   FETCH_CONSTANT                                   ~32     'CURLOPT_URL'
         44        ASSIGN_DIM_OP                .=               8          !4, ~32
         45        OP_DATA                                                  !2
  211    46    >   INIT_FCALL_BY_NAME                                       'curl_init'
         47        DO_FCALL                                      0  $34     
         48        ASSIGN                                                   !5, $34
  212    49        INIT_FCALL_BY_NAME                                       'curl_setopt_array'
         50        SEND_VAR_EX                                              !5
         51        SEND_VAR_EX                                              !4
         52        DO_FCALL                                      0          
  213    53        INIT_FCALL_BY_NAME                                       'curl_exec'
         54        SEND_VAR_EX                                              !5
         55        DO_FCALL                                      0  $37     
         56        ASSIGN                                                   !6, $37
  214    57        INIT_FCALL_BY_NAME                                       'curl_close'
         58        SEND_VAR_EX                                              !5
         59        DO_FCALL                                      0          
  216    60      > JMPZ                                                     !0, ->62
         61    > > RETURN                                                   !6
  217    62    > > RETURN                                                   null

End of function performrequest

Function buildbasestring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/FhStI
function name:  buildBaseString
number of ops:  33
compiled vars:  !0 = $baseURI, !1 = $method, !2 = $params, !3 = $return, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  228     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  230     3        ASSIGN                                                   !3, <array>
  231     4        INIT_FCALL                                               'ksort'
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
  233     7      > FE_RESET_R                                       $8      !2, ->16
          8    > > FE_FETCH_R                                       ~9      $8, !4, ->16
          9    >   ASSIGN                                                   !5, ~9
  235    10        NOP                                                      
         11        FAST_CONCAT                                      ~12     !5, '%3D'
         12        CONCAT                                           ~13     ~12, !4
         13        ASSIGN_DIM                                               !3
         14        OP_DATA                                                  ~13
  233    15      > JMP                                                      ->8
         16    >   FE_FREE                                                  $8
  238    17        CONCAT                                           ~14     !1, '%26'
         18        INIT_FCALL                                               'rawurlencode'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $15     
         21        CONCAT                                           ~16     ~14, $15
         22        CONCAT                                           ~17     ~16, '%26'
         23        INIT_FCALL                                               'rawurlencode'
         24        INIT_FCALL                                               'implode'
         25        SEND_VAL                                                 '%26'
         26        

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.55 ms | 1428 KiB | 39 Q