WP_Query – Object manipulation vs WordPress functions

All 3 of these could do the same thing, it’s just a matter of how you want to use them.

the_title() calls get_the_title() which gets the title by $post->post_title.

View the_title() Source on Trac

View get_the_title() Source on Trac

Personally, I would never use choice 3 as from a readability stand point it’s not the most obvious what it’s doing. On top of that as Milo points out, you do lose the_title filter which is found in get_the_title():

return apply_filters( 'the_title', $title, $id );

Choice 1 / 2 are used in different scenarios. You can never assign the_title() ( without any parameters ) to a variable because by default it will echo out the title to the screen. The function get_the_title() is used to actually assign the title to a variable should you need to run any kind of manipulation on the post title.

You could use any of the choices to achieve the same result it just depends what you’re trying to do.