3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once("TwitterAPIExchange.php"); 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; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I7S10
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'TwitterAPIExchange.php', REQUIRE_ONCE
    4     1        DECLARE_CLASS                                            'tweet', 'twitterapiexchange'
   45     2      > RETURN                                                   1

Class Tweet:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I7S10
function name:  __construct
number of ops:  9
compiled vars:  !0 = $settings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   22     1        NEW                                              $3      'TwitterAPIExchange'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'twitter'
          5        OP_DATA                                                  $3
   23     6        FETCH_THIS                                       ~5      
          7      > RETURN                                                   ~5
   24     8*     > RETURN                                                   null

End of function __construct

Function set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I7S10
function name:  set
number of ops:  19
compiled vars:  !0 = $json, !1 = $get
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   28     2        CONCAT                                           ~3      'https%3A%2F%2Fapi.twitter.com%2F1.1%2F', !0
          3        CONCAT                                           ~4      ~3, '.json'
          4        ASSIGN_OBJ                                               'json'
          5        OP_DATA                                                  ~4
   29     6        TYPE_CHECK                                  128          !1
          7      > JMPZ                                                     ~5, ->14
   30     8    >   INIT_FCALL                                               'http_build_query'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN_OBJ                                               'get'
         12        OP_DATA                                                  $7
         13      > JMP                                                      ->16
   32    14    >   ASSIGN_OBJ                                               'get'
         15        OP_DATA                                                  !1
   34    16    >   FETCH_THIS                                       ~9      
         17      > RETURN                                                   ~9
   35    18*     > RETURN                                                   null

End of function set

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I7S10
function name:  call
number of ops:  23
compiled vars:  !0 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   FETCH_OBJ_R                                      ~1      'twitter'
          1        INIT_METHOD_CALL                                         ~1, 'setGetfield'
          2        FETCH_OBJ_R                                      ~2      'get'
          3        CONCAT                                           ~3      '%3F', ~2
          4        SEND_VAL_EX                                              ~3
          5        DO_FCALL                                      0  $4      
   39     6        INIT_METHOD_CALL                                         $4, 'buildOauth'
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $5      'json'
          9        SEND_FUNC_ARG                                            $5
         10        SEND_VAL_EX                                              'GET'
         11        DO_FCALL                                      0  $6      
   40    12        INIT_METHOD_CALL                                         $6, 'performRequest'
         13        DO_FCALL                                      0  $7      
   38    14        ASSIGN                                                   !0, $7
   41    15        INIT_FCALL                                               'json_decode'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $9      
         19        ASSIGN                                                   !0, $9
   42    20        CAST                                          7  ~11     !0
         21      > RETURN                                                   ~11
   43    22*     > RETURN                                                   null

End of function call

End of class Tweet.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.55 ms | 1400 KiB | 17 Q