Extracting the permalink from a post instance

Thanks to Tom’s suggestion of searching for permalink instead of pretty URLs I found the get_permalink function.

$permalink = get_permalink($post->ID);

error code: 523