Advertising is a constant battle fought between a brand and the reluctance of a consumer to purchase items. If the purchase takes place, the advertising will have won. If no purchase happens, the effectiveness of the whole advertising campaign is put into question.
Functionality in advertising is that attribute of the campaign by which a brand or company achieves an action by a consumer. Normally, functionality is linked to good communication and a differential advantage.
In this case, McDonald's has both. Through a humorous ad aimed at its young target market, it manages to transmit its advantage: open 24 hours. And it also does it through showing its own product. Simple but powerful.