It appears that $result is not an array - and to be honest this doesn't seem like a very well thought out function. Try looking into the class in question Zend/Rest/Client/Result.php, seeing what $result is and if the call to Twitter is actually successful.