function ShowPageUser($id = Null){
$vk = new \VK\Client\VKApiClient();
$vk_token = ********;
if ($id == Null) {
$id = 1;
$response = $vk->users()->get($vk_token, array(
'user_ids' => array($id),
'fields' => array('photo')
));
return json_encode($response[0]);
} else {
$response = $vk->users()->get($vk_token, array(
'user_ids' => array($id),
'fields' => array('photo_id, counters, verified, sex, bdate, city, country, home_town, has_photo, photo_50, photo_200, photo_400_orig, photo_max_orig, online, domain, has_mobile, contacts, site, education, universities, schools, status, last_seen, followers_count, common_count, occupation, nickname, relatives, relation, personal, connections, exports, activities, interests, music, movies, tv, books, games, about, quotes, can_post, can_see_all_posts, can_see_audio, can_write_private_message, can_send_friend_request, is_favorite, is_hidden_from_feed, timezone, screen_name, maiden_name, crop_photo, is_friend, friend_status, career, military, blacklisted, blacklisted_by_me, can_be_invited_group')
));
if(!empty($response[0])){
$result = $response[0];
}else{
if(!empty(json_decode($response)->error->error_code)) {
$result = array('error' => 'true');
}
}
return json_encode($result);
}
}
Метод ничего не возвращает и крашится если пользователя нет... Пример ShowPageUser('dv20')