$params = array(
'client_id' => '---',
'client_secret' => '----',
'redirect_uri' => '---',
'code' => $_GET['code']
);
$token = file_get_contents('https://oauth.vk.com/access_token?' . http_build_query($params, null, '&'));
//ответ будет такой {"access_token":"****","expires_in":"*****","user_id":"*****","email":"****"}
echo $token['user_id']; //строка с ошибкой