Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fatal Error: InvalidArgumentException #139

bradbernard opened this Issue · 6 comments

2 participants


I am getting a PHP Fatal Error: InvalidArgumentException a lot and was wondering how to fix it. Here is the error_log:

[22-Mar-2012 20:01:40] PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /home/bradley/public_html/twitter/EpiTwitter.php:174
Stack trace:
#0 /home/bradley/public_html/twitter/EpiTwitter.php(174): ArrayIterator->__construct(NULL)
#1 /home/bradley/public_html/index.php(394): EpiTwitterJson->getIterator()
#2 {main}

$comma_separated = implode(",", $followingarr);
$usernames = $twitterObj->post('/users/lookup.json' , array('user_id' => $comma_separated));
$followingarray = array();
foreach ($usernames as $user) {
$followingarray[] = array('username' => $user->screen_name, 'id' => $user->id);

I commented out lines 171 + 172 in EpiOAuth.php but it did not fix it for me.

Any help?


Ok, I dumped the responseText and it is very large. Here is a pastebin link:

Twitter allows POST/GET on users/lookup:

The error happens very quickly, right when the page loads. It seems as if I am trying to loop through the $usernames before it has actually gotten the data from the API. Isn't it supposed to block?


I noticed you have made some changes to the files recently. I downloaded the files roughly a year ago. Should I download the new files? Are there any significant changes?

I get that error every 10 minutes on my website which is way too much...


Another error I'm getting:

[11-Mar-2012 15:57:27] PHP Fatal error: Uncaught exception 'EpiOAuthUnauthorizedException' in /home/bradley/public_html/twitter/EpiOAuth.php:421
Stack trace:
#0 /home/bradley/public_html/twitter/EpiOAuth.php(393): EpiOAuthException::raise(Object(EpiCurlManager), false)
#1 /home/bradley/public_html/twitter/callback.php(14): EpiOAuthResponse->__get('oauth_token')
#2 {main}
thrown in /home/bradley/public_html/twitter/EpiOAuth.php on line 421



$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
if (isset($_GET['denied']) && $_GET['denied'] != '')
header('Location: ../me');

$token = $twitterObj->getAccessToken();
#14 - $twitterObj->setToken($token->oauth_token, $token->oauth_token_secret);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.