Twitter API 29994 user ids error
===

From REST API of twitter I user get/followers function.
I pasted a code snippet below.

My problem is, modt of the time I get followers' ids successfully. But when a user has more than 5000-6000 followers then my results comes wrong.

When I check from user's profile page, I see that user has 5500 followers, but when I run following code, most of the time 5500 ids come, but sometimes 29994 followers come inside $ids variable. Now I'm logging the results having more then 29k followers. I saw some of the requests returned with 29994 followers, but I couldn't find the answer.

Do I miss something in get ids - cursor approach? Thank you

    public function getIds($user = "someuser"){
    	$tmhOAuth = new tmhOAuth(array( 'consumer_key'    => YOUR_CONSUMER_KEY, 
                  'consumer_secret' => YOUR_CONSUMER_SECRET,
                  'user_token'      => $atoken1, 'user_secret'     => $atoken2, ));
    
    	$cursor = '-1';
    	$ids = array();
    	while(true):
    		$code=$tmhOAuth->request('GET', $tmhOAuth->url('1/followers/ids'),
                    array('screen_name' => $user, 'cursor' => $cursor));
    
    		if ($code == 200) {
                $responseData = json_decode($tmhOAuth->response['response'],true);
    			$ids = array_merge($ids, $responseData['ids']);
    			$cursor = $responseData['next_cursor_str'];
    		} else {
    			return 0;
    		}
    		if ( $cursor == '0' ) {
    			break;
    		}
    	endwhile;
    
    	return $ids;
    }


