Fatal error: Call to undefined method TwitterOAuth::request()


#1

These are my code. I want to get twitter timeline to my website. But my browser keep shows me this error. I dun know what is the problem.
Fatal error: Call to undefined method TwitterOAuth::request()

I am new to Twitter api.

<?php
define("CONSUMER_KEY", "my consumer key");
define("CONSUMER_SECRET", "my consumer secret");
define("OAUTH_TOKEN", "my oauth token");
define("OAUTH_SECRET", "my oauth secret");

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN,     OAUTH_SECRET);

// https://dev.twitter.com/docs/api/1.1/get/users/show
// Get User details

$user_id = 123456789; // user id can be fetched and stored from step 2.
$user_name = 'xxxx'; // screen name can be fetched and stored from step 2.

$content = $connection->get('account/verify_credentials');

$connection->request('GET', $connection->url('1.1/users/show'), array('screen_name' =>     $user_name));

print '<pre>'; 
$decode_response = json_decode($code);
print_r($decode_response);
// It gives you - id, name, screen name, location, description, url, 
// followers count, following count, latest status, etc.
?>