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 * @version 1.0.4 * @link http://github.com/j7mbo/twitter-api-php */ class TwitterAPIExchange { /** * @var string */ private $oauth_access_token; /** * @var string */ private $oauth_access_token_secret; /** * @var string */ private $consumer_key; /** * @var string */ private $consumer_secret; /** * @var array */ private $postfields; /** * @var string */ private $getfield; /** * @var mixed */ protected $oauth; /** * @var string */ public $url; /** * @var string */ public $requestMethod; /** * 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 * * @throws \Exception When cURL isn't installed or incorrect settings parameters are provided * * @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 * * @throws \Exception When you are trying to set both get and post fields * * @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']); } foreach ($array as $key => &$value) { if (is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } } $this->postfields = $array; // rebuild oAuth if (isset($this->oauth['oauth_signature'])) { $this->buildOauth($this->url, $this->requestMethod); } return $this; } /** * Set getfield string, example: '?screen_name=J7mbo' * * @param string $string Get key and value pairs as string * * @throws \Exception * * @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.'); } $getfields = preg_replace('/^\?/', '', explode('&', $string)); $params = array(); foreach ($getfields as $field) { if ($field !== '') { list($key, $value) = explode('=', $field); $params[$key] = $value; } } $this->getfield = '?' . http_build_query($params); 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 * * @throws \Exception * * @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); /** In case a null is passed through **/ if (isset($split[1])) { $oauth[$split[0]] = urldecode($split[1]); } } } $postfields = $this->getPostfields(); if (!is_null($postfields)) { foreach ($postfields as $key => $value) { $oauth[$key] = $value; } } $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->requestMethod = $requestMethod; $this->oauth = $oauth; return $this; } /** * Perform the actual data retrieval from the API * * @param boolean $return If true, returns data. This is left in for backward compatibility reasons * @param array $curlOptions Additional Curl options for this request * * @throws \Exception * * @return string json If $return param is true, returns json data. */ public function performRequest($return = true, $curlOptions = array()) { 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, ) + $curlOptions; if (!is_null($postfields)) { $options[CURLOPT_POSTFIELDS] = http_build_query($postfields); } else { if ($getfield !== '') { $options[CURLOPT_URL] .= $getfield; } } $feed = curl_init(); curl_setopt_array($feed, $options); $json = curl_exec($feed); if (($error = curl_error($feed)) !== '') { curl_close($feed); throw new \Exception($error); } curl_close($feed); 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[] = rawurlencode($key) . '=' . rawurlencode($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(array $oauth) { $return = 'Authorization: OAuth '; $values = array(); foreach($oauth as $key => $value) { if (in_array($key, array('oauth_consumer_key', 'oauth_nonce', 'oauth_signature', 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', 'oauth_version'))) { $values[] = "$key=\"" . rawurlencode($value) . "\""; } } $return .= implode(', ', $values); return $return; } /** * Helper method to perform our request * * @param string $url * @param string $method * @param string $data * @param array $curlOptions * * @throws \Exception * * @return string The json response from the server */ public function request($url, $method = 'get', $data = null, $curlOptions = array()) { if (strtolower($method) === 'get') { $this->setGetfield($data); } else { $this->setPostfields($data); } return $this->buildOauth($url, $method)->performRequest(true, $curlOptions); } } function sendTweet($mensaje){ ini_set('display_errors', 1); /** Set access tokens here - see: https://dev.twitter.com/apps/ **/ $settings = array( 'oauth_access_token' => "4504615637-kc5wZ8R2J4STqx0EV1K1yDQeZlsDxUwX0dFmsN8", 'oauth_access_token_secret' => "ZMoySIqNzs4xtFrwjCSflxqhQZm27UG7Tn1irVDmecKu5", 'consumer_key' => "5owc9irNZhx6wbJbY2NyYZi6X", 'consumer_secret' => "FNtmNO4TCQcCmcaIOm42FDvEsttWD6bhXW4QrEuY6Hcj9IFuAT" ); $url = 'https://api.twitter.com/1.1/statuses/update.json'; $requestMethod = 'POST'; /** POST fields required by the URL above. See relevant docs as above **/ $postfields = array( 'status' => $mensaje, ); /** Perform a POST request and echo the response **/ $twitter = new TwitterAPIExchange($settings); return $twitter->buildOauth($url, $requestMethod)->setPostfields($postfields)->performRequest(); } $mensaje = "Tutorial realizado con éxito en @GeekyTheory. #PHP + #Twitter: Cómo enviar tweets desde PHP | http://geekytheory.com/php-twitter-como-enviar-tweets-desde-php"; $respuesta = sendTweet($mensaje); $json = json_decode($respuesta); echo '<meta charset="utf-8">'; echo "Tweet Enviado por: ".$json->user->name." (@".$json->user->screen_name.")"; echo "<br>"; echo "Tweet: ".$json->text; echo "<br>"; echo "Tweet ID: ".$json->id_str; echo "<br>"; echo "Fecha Envio: ".$json->created_at; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DBLXl
function name:  (null)
number of ops:  32
compiled vars:  !0 = $mensaje, !1 = $respuesta, !2 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  405     0  E >   ASSIGN                                                   !0, 'Tutorial+realizado+con+%C3%A9xito+en+%40GeekyTheory.+%23PHP+%2B+%23Twitter%3A+C%C3%B3mo+enviar+tweets+desde+PHP+%7C++http%3A%2F%2Fgeekytheory.com%2Fphp-twitter-como-enviar-tweets-desde-php'
  406     1        INIT_FCALL                                               'sendtweet'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
  407     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
  409     9        ECHO                                                     '%3Cmeta+charset%3D%22utf-8%22%3E'
  410    10        FETCH_OBJ_R                                      ~8      !2, 'user'
         11        FETCH_OBJ_R                                      ~9      ~8, 'name'
         12        CONCAT                                           ~10     'Tweet+Enviado+por%3A+', ~9
         13        CONCAT                                           ~11     ~10, '+%28%40'
         14        FETCH_OBJ_R                                      ~12     !2, 'user'
         15        FETCH_OBJ_R                                      ~13     ~12, 'screen_name'
         16        CONCAT                                           ~14     ~11, ~13
         17        CONCAT                                           ~15     ~14, '%29'
         18        ECHO                                                     ~15
  411    19        ECHO                                                     '%3Cbr%3E'
  412    20        FETCH_OBJ_R                                      ~16     !2, 'text'
         21        CONCAT                                           ~17     'Tweet%3A+', ~16
         22        ECHO                                                     ~17
  413    23        ECHO                                                     '%3Cbr%3E'
  414    24        FETCH_OBJ_R                                      ~18     !2, 'id_str'
         25        CONCAT                                           ~19     'Tweet+ID%3A+', ~18
         26        ECHO                                                     ~19
  415    27        ECHO                                                     '%3Cbr%3E'
  416    28        FETCH_OBJ_R                                      ~20     !2, 'created_at'
         29        CONCAT                                           ~21     'Fecha+Envio%3A+', ~20
         30        ECHO                                                     ~21
  417    31      > RETURN                                                   1

Function sendtweet:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DBLXl
function name:  sendTweet
number of ops:  25
compiled vars:  !0 = $mensaje, !1 = $settings, !2 = $url, !3 = $requestMethod, !4 = $postfields, !5 = $twitter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  385     0  E >   RECV                                             !0      
  386     1        INIT_FCALL                                               'ini_set'
          2        SEND_VAL                                                 'display_errors'
          3        SEND_VAL                                                 1
          4        DO_ICALL                                                 
  389     5        ASSIGN                                                   !1, <array>
  396     6        ASSIGN                                                   !2, 'https%3A%2F%2Fapi.twitter.com%2F1.1%2Fstatuses%2Fupdate.json'
  397     7        ASSIGN                                                   !3, 'POST'
  399     8        INIT_ARRAY                                       ~10     !0, 'status'
          9        ASSIGN                                                   !4, ~10
  401    10        NEW                                              $12     'TwitterAPIExchange'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !5, $12
  402    14        INIT_METHOD_CALL                                         !5, 'buildOauth'
         15        SEND_VAR_EX                                              !2
         16        SEND_VAR_EX                                              !3
         17        DO_FCALL                                      0  $15     
         18        INIT_METHOD_CALL                                         $15, 'setPostfields'
         19        SEND_VAR_EX                                              !4
         20        DO_FCALL                                      0  $16     
         21        INIT_METHOD_CALL                                         $16, 'performRequest'
         22        DO_FCALL                                      0  $17     
         23      > RETURN                                                   $17
  403    24*     > RETURN                                                   null

End of function sendtweet

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/DBLXl
function name:  __construct
number of ops:  45
compiled vars:  !0 = $settings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   RECV                                             !0      
   74     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
   76     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
   79    13    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !0, 'oauth_access_token'
         14        BOOL_NOT                                         ~7      ~6
         15      > JMPNZ_EX                                         ~7      ~7, ->19
   80    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
   81    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
   82    24    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !0, 'consumer_secret'
         25        BOOL_NOT                                         ~13     ~12
         26        BOOL                                             ~7      ~13
         27    > > JMPZ                                                     ~7, ->32
   84    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
   87    32    >   FETCH_DIM_R                                      ~17     !0, 'oauth_access_token'
         33        ASSIGN_OBJ                                               'oauth_access_token'
         34        OP_DATA                                                  ~17
   88    35        FETCH_DIM_R                                      ~19     !0, 'oauth_access_token_secret'
         36        ASSIGN_OBJ                                               'oauth_access_token_secret'
         37        OP_DATA                                                  ~19
   89    38        FETCH_DIM_R                                      ~21     !0, 'consumer_key'
         39        ASSIGN_OBJ                                               'consumer_key'
         40        OP_DATA                                                  ~21
   90    41        FETCH_DIM_R                                      ~23     !0, 'consumer_secret'
         42        ASSIGN_OBJ                                               'consumer_secret'
         43        OP_DATA                                                  ~23
   91    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
2 jumps found. (Code = 125) Position 1 = 29, Position 2 = 40
Branch analysis from position: 29
2 jumps found. (Code = 126) Position 1 = 30, Position 2 = 40
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 39
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 54
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 40
Branch analysis from position: 28
Branch analysis from position: 20
filename:       /in/DBLXl
function name:  setPostfields
number of ops:  57
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  102     0  E >   RECV                                             !0      
  104     1        INIT_METHOD_CALL                                         'getGetfield'
          2        DO_FCALL                                      0  $3      
          3        TYPE_CHECK                                    2  ~4      $3
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->10
  106     6    >   NEW                                              $6      'Exception'
          7        SEND_VAL_EX                                              'You+can+only+choose+get+OR+post+fields.'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $6
  109    10    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~8      !0, 'status'
         11      > JMPZ_EX                                          ~8      ~8, ->20
         12    >   INIT_FCALL                                               'substr'
         13        FETCH_DIM_R                                      ~9      !0, 'status'
         14        SEND_VAL                                                 ~9
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $10     
         18        IS_IDENTICAL                                     ~11     $10, '%40'
         19        BOOL                                             ~8      ~11
         20    > > JMPZ                                                     ~8, ->28
  111    21    >   INIT_FCALL                                               'sprintf'
         22        SEND_VAL                                                 '%00%25s'
         23        FETCH_DIM_R                                      ~13     !0, 'status'
         24        SEND_VAL                                                 ~13
         25        DO_ICALL                                         $14     
         26        ASSIGN_DIM                                               !0, 'status'
         27        OP_DATA                                                  $14
  114    28    > > FE_RESET_RW                                      $15     !0, ->40
         29    > > FE_FETCH_RW                                      ~16     $15, !1, ->40
         30    >   ASSIGN                                                   !2, ~16
  116    31        TYPE_CHECK                                   12          !1
         32      > JMPZ                                                     ~18, ->39
  118    33    >   TYPE_CHECK                                    8          !1
         34      > JMPZ                                                     ~19, ->37
         35    >   QM_ASSIGN                                        ~20     'true'
         36      > JMP                                                      ->38
         37    >   QM_ASSIGN                                        ~20     'false'
         38    >   ASSIGN                                                   !1, ~20
  114    39    > > JMP                                                      ->29
         40    >   FE_FREE                                                  $15
  122    41        ASSIGN_OBJ                                               'postfields'
         42        OP_DATA                                                  !0
  125    43        FETCH_OBJ_IS                                     ~23     'oauth'
         44        ISSET_ISEMPTY_DIM_OBJ                         0          ~23, 'oauth_signature'
         45      > JMPZ                                                     ~24, ->54
  126    46    >   INIT_METHOD_CALL                                         'buildOauth'
         47        CHECK_FUNC_ARG                                           
         48        FETCH_OBJ_FUNC_ARG                               $25     'url'
         49        SEND_FUNC_ARG                                            $25
         50        CHECK_FUNC_ARG                                           
         51        FETCH_OBJ_FUNC_ARG                               $26     'requestMethod'
         52        SEND_FUNC_ARG                                            $26
         53        DO_FCALL                                      0          
  129    54    >   FETCH_THIS                                       ~28     
         55      > RETURN                                                   ~28
  130    56*     > 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
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 37
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 37
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 36
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/DBLXl
function name:  setGetfield
number of ops:  47
compiled vars:  !0 = $string, !1 = $getfields, !2 = $params, !3 = $field, !4 = $key, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  141     0  E >   RECV                                             !0      
  143     1        INIT_METHOD_CALL                                         'getPostfields'
          2        DO_FCALL                                      0  $6      
          3        TYPE_CHECK                                    2  ~7      $6
          4        BOOL_NOT                                         ~8      ~7
          5      > JMPZ                                                     ~8, ->10
  145     6    >   NEW                                              $9      'Exception'
          7        SEND_VAL_EX                                              'You+can+only+choose+get+OR+post+fields.'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $9
  148    10    >   INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%5E%5C%3F%2F'
         12        SEND_VAL                                                 ''
         13        INIT_FCALL                                               'explode'
         14        SEND_VAL                                                 '%26'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $11     
         17        SEND_VAR                                                 $11
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !1, $12
  149    20        ASSIGN                                                   !2, <array>
  151    21      > FE_RESET_R                                       $15     !1, ->37
         22    > > FE_FETCH_R                                               $15, !3, ->37
  153    23    >   IS_NOT_IDENTICAL                                         !3, ''
         24      > JMPZ                                                     ~16, ->36
  155    25    >   INIT_FCALL                                               'explode'
         26        SEND_VAL                                                 '%3D'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $17     
         29        FETCH_LIST_R                                     $18     $17, 0
         30        ASSIGN                                                   !4, $18
         31        FETCH_LIST_R                                     $20     $17, 1
         32        ASSIGN                                                   !5, $20
         33        FREE                                                     $17
  156    34        ASSIGN_DIM                                               !2, !4
         35        OP_DATA                                                  !5
  151    36    > > JMP                                                      ->22
         37    >   FE_FREE                                                  $15
  160    38        INIT_FCALL                                               'http_build_query'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                         $24     
         41        CONCAT                                           ~25     '%3F', $24
         42        ASSIGN_OBJ                                               'getfield'
         43        OP_DATA                                                  ~25
  162    44        FETCH_THIS                                       ~26     
         45      > RETURN                                                   ~26
  163    46*     > 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/DBLXl
function name:  getGetfield
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  172     0  E >   FETCH_OBJ_R                                      ~0      'getfield'
          1      > RETURN                                                   ~0
  173     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/DBLXl
function name:  getPostfields
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  182     0  E >   FETCH_OBJ_R                                      ~0      'postfields'
          1      > RETURN                                                   ~0
  183     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 = 65
Branch analysis from position: 37
2 jumps found. (Code = 77) Position 1 = 48, Position 2 = 64
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 64
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 63
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 63
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 78
Branch analysis from position: 71
2 jumps found. (Code = 77) Position 1 = 72, Position 2 = 77
Branch analysis from position: 72
2 jumps found. (Code = 78) Position 1 = 73, Position 2 = 77
Branch analysis from position: 73
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
Branch analysis from position: 77
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 77
Branch analysis from position: 78
Branch analysis from position: 64
Branch analysis from position: 65
filename:       /in/DBLXl
function name:  buildOauth
number of ops:  114
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 = $postfields, !12 = $value, !13 = $key, !14 = $base_info, !15 = $composite_key, !16 = $oauth_signature
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  196     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  198     2        INIT_FCALL                                               'strtolower'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $17     
          5        IN_ARRAY                                         ~18     $17, <array>
          6        BOOL_NOT                                         ~19     ~18
          7      > JMPZ                                                     ~19, ->12
  200     8    >   NEW                                              $20     'Exception'
          9        SEND_VAL_EX                                              'Request+method+must+be+either+POST+or+GET'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $20
  203    12    >   FETCH_OBJ_R                                      ~22     'consumer_key'
         13        ASSIGN                                                   !2, ~22
  204    14        FETCH_OBJ_R                                      ~24     'consumer_secret'
         15        ASSIGN                                                   !3, ~24
  205    16        FETCH_OBJ_R                                      ~26     'oauth_access_token'
         17        ASSIGN                                                   !4, ~26
  206    18        FETCH_OBJ_R                                      ~28     'oauth_access_token_secret'
         19        ASSIGN                                                   !5, ~28
  209    20        INIT_ARRAY                                       ~30     !2, 'oauth_consumer_key'
  210    21        INIT_FCALL                                               'time'
         22        DO_ICALL                                         $31     
         23        ADD_ARRAY_ELEMENT                                ~30     $31, 'oauth_nonce'
  211    24        ADD_ARRAY_ELEMENT                                ~30     'HMAC-SHA1', 'oauth_signature_method'
  212    25        ADD_ARRAY_ELEMENT                                ~30     !4, 'oauth_token'
  213    26        INIT_FCALL                                               'time'
         27        DO_ICALL                                         $32     
         28        ADD_ARRAY_ELEMENT                                ~30     $32, 'oauth_timestamp'
  214    29        ADD_ARRAY_ELEMENT                                ~30     '1.0', 'oauth_version'
  208    30        ASSIGN                                                   !6, ~30
  217    31        INIT_METHOD_CALL                                         'getGetfield'
         32        DO_FCALL                                      0  $34     
         33        ASSIGN                                                   !7, $34
  219    34        TYPE_CHECK                                    2  ~36     !7
         35        BOOL_NOT                                         ~37     ~36
         36      > JMPZ                                                     ~37, ->65
  221    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                                         $38     
         44        SEND_VAR                                                 $38
         45        DO_ICALL                                         $39     
         46        ASSIGN                                                   !8, $39
  223    47      > FE_RESET_R                                       $41     !8, ->64
         48    > > FE_FETCH_R                                               $41, !9, ->64
  225    49    >   INIT_FCALL                                               'explode'
         50        SEND_VAL                                                 '%3D'
         51        SEND_VAR                                                 !9
         52        DO_ICALL                                         $42     
         53        ASSIGN                                                   !10, $42
  228    54        ISSET_ISEMPTY_DIM_OBJ                         0          !10, 1
         55      > JMPZ                                                     ~44, ->63
  230    56    >   FETCH_DIM_R                                      ~45     !10, 0
         57        INIT_FCALL                                               'urldecode'
         58        FETCH_DIM_R                                      ~47     !10, 1
         59        SEND_VAL                                                 ~47
         60        DO_ICALL                                         $48     
         61        ASSIGN_DIM                                               !6, ~45
         62        OP_DATA                                                  $48
  223    63    > > JMP                                                      ->48
         64    >   FE_FREE                                                  $41
  235    65    >   INIT_METHOD_CALL                                         'getPostfields'
         66        DO_FCALL                                      0  $49     
         67        ASSIGN                                                   !11, $49
  237    68        TYPE_CHECK                                    2  ~51     !11
         69        BOOL_NOT                                         ~52     ~51
         70      > JMPZ                                                     ~52, ->78
  238    71    > > FE_RESET_R                                       $53     !11, ->77
         72    > > FE_FETCH_R                                       ~54     $53, !12, ->77
         73    >   ASSIGN                                                   !13, ~54
  239    74        ASSIGN_DIM                                               !6, !13
         75        OP_DATA                                                  !12
  238    76      > JMP                                                      ->72
         77    >   FE_FREE                                                  $53
  243    78    >   INIT_METHOD_CALL                                         'buildBaseString'
         79        SEND_VAR_EX                                           

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.17 ms | 1431 KiB | 40 Q