Мой вариант происходящего.
$photo = (object) array(
'id' => 456239017,
'album_id' => -7,
'owner_id' => -119862681,
'user_id' => 100,
'photo_75' => 'https://pp.userapi.com/c638522/v638522457/47abd/T0LAROT98EI.jpg',
'photo_130' => 'https://pp.userapi.com/c638522/v638522457/47abe/GwUvwaKff_I.jpg',
'photo_604' => 'https://pp.userapi.com/c638522/v638522457/47abf/jVm1hsXC7Nc.jpg',
'photo_807' => 'https://pp.userapi.com/c638522/v638522457/47ac0/75K-RSy1kQc.jpg',
'width' => 800,
'height' => 800,
'text' => 'Original: http://cs639119.userapi.com/v639119880/12bab/3czHoHZnZGs.jpg',
'date' => 1491404363,
'post_id' => 126,
'access_key' => 'b7132ccfd6d6e03c98'
);
$max_photo = array(
'size' => 0,
'url' => null
);
foreach($photo as $key => $value) {
preg_match('/photo_([0-9]+)/', $key, $matches);
if ($matches && $matches[1] > $max_photo['size']) {
$max_photo = array(
'size' => intval($matches[1]),
'url' => $value
);
}
}
var_dump($max_photo);