Celebrity cameos are a classic form of fanservice. When they're done right, they can make a whole movie better even if the scene only lasts a few minutes. Sometimes celebrities appear for a moment in movies as simply an extra that's meant to be more of an Easter egg.

Other times a celebrity appears as themselves to mentor another character or make fun of their own public persona. There are so many hilarious celebrity movie cameos out there that it's tough to decide on some of them. Here are a few of the funniest cameos in movies when celebrities played themselves.

RELATED: 10 Celebrity Cameos That Hurt Superhero Movies (And 10 That Stole The Show)

Bob Barker - Happy Gilmore

happy-gilmore-barker-sandler

If these were ranked, Bob Barker's appearance in Happy Gilmore would be a strong contender for first place. The basic premise of what could be Adam Sandler's best comedy is an aspiring hockey player who has to leave the sport because he just doesn't have what it takes. So, he turns to golf, and hilarity ensues.

Even though Happy's skill level is fairly low, he thinks a win against an amiable, retired game show host will be an easy win. This attitude continues when the game gets ugly, but Happy learns a hard lesson when he pushes cheerful Mr. Barker too far. It's hysterical because it's not only well deserved but completely unexpected, and peppered with some immortal one-liners that we can't repeat here.

Stan Lee - Mallrats

Stan Lee Mallrats Cameo

Stan Lee's dialogue in these few scenes is actually quite down to earth. It's the character Brodie's reaction them makes this so funny. Brodie and his friend T.S., both recently single, spend a day at the mall to try and forget their troubles. Brodie, who is a comic book fiend, bumps into none other than Stan Lee during their adventures.

RELATED: Marvel Studios Compiling Behind the Scenes Look at Stan Lee's MCU Cameos

He doesn't hold back when he realizes who Lee is, which echoes the feelings of so many in the audience. Lee gives him some advice about life, the universe, and relationships before taking his leave. What makes this scene all the more poignant now is that a line of dialogue from this sequence was part of Stan Lee's final cameo in Captain Marvel, "Trust me, true believer." We trust you, Stan, implicitly.

Kareem Abdul-Jabbar - Airplane

In a movie that never lets up when it comes to the laughs, to say this is one of the funniest scenes is saying a lot. Keep in mind that the pilot sitting next to Kareem has been the start of many an internet meme, such as "Billy, do you like movies about gladiators?"

What makes it go great is that Abdul-Jabbar is trying to stay in character, even when an adorable child visiting the cockpit recognizes him as the famous basketball player. He snaps, however, when the sweet little boy repeats something unflattering about his gameplay. Abdul-Jabbar comes out of character not only to defend himself but throw some shade on fellow players for not carrying their own weight. The look on Billy's face after the diatribe is equally priceless.

Neil Patrick Harris - Harold and Kumar Go To White Castle 

Neil Patrick Harris usually plays clean-cut, average guys without a thing to hide. The sex-crazed, drug-addled maniac is the complete opposite of any of those characters, so Harris is really playing a fictional version of himself that makes fun of his spotless public image. Harold and Kumar are in enough trouble as it is when Harris latches on to them as a wayward hitchhiker.

He's high and looking for women of the night, for starters. Then he steals their car when they get out to ask for directions. What completes this perfectly is his appearance the next morning as he nonchalantly returns and gives them some money for their meals and any "stains" left in the car.

Bill Murray - Zombieland

Bill Murray has a reputation for showing up in weird places as it is, so when he turns up playing himself in Zombieland it's a pleasant but not huge surprise.  The main character, Columbus, is a huge fan of the 1980s comedy star, so when the group reaches Hollywood he follows a "map to the stars" to his house.

He even does a few lines from the original Ghostbusters to drive the point home. He's one of the survivors of the zombie apocalypse, and his clever method of survival is pure Murray. Unfortunately, his trick in this regard is too good, as he is mistaken for a zombie by one of the main characters and shot.

Alice Cooper - Wayne's World

Alice Cooper looks on in Wayne's World

In a similar way to Niel Patrick Harris in Harold and Kumar Go to White Castle, Cooper parodies himself in this brief cameo. When the villain Benjamin Oliver offers Wayne and Garth backstage passes to an Alice Cooper concert, of course, our heroes can't resist. Instead of the unhinged party animal that they expected, Wayne and Garth find a calm, reserved Cooper relaxing in in a quiet and very civilized lounge, and he proceeds to lecture his visitors on the history of Milwaukee.

RELATED: 10 Great Movies Everyone Forgets Are Directed By Women

This does nothing to taint the awe of Wayne and Garth, who collapses into fawning worship of their hero in a barrage of self-depreciation and cries of "We're not worthy." To which Cooper quietly extends a hand as if he wants them to kiss his ring.

Mike Tyson - The Hangover

Among other things, the main characters of The Hangover find a tiger in their bathroom the next morning. The owner eventually tracks them down, and it's none other than Mike Tyson. It's a complete surprise, especially since when he first appears, he's singing the ominous Phil Collins tune, In the Air Tonight. 

He gets the other characters to sing along with him before knocking Alan out, which is something everyone was waiting to see happen. Their ordeal with Tyson doesn't end until they manage, with great difficulty, to get the carnivorous beast back to Tyson's house. Once they arrive, Tyson shows them the video that proves they stole the tiger and compliments them on stealing a cop car.

David Bowie - Zoolander

Who else would be able to judge a model walk-off than Ziggy Stardust himself? That's one of the things that makes this cameo so perfect, and also because, somehow, we didn't see it coming. The whole contest is set up like a boxing ring and is an obvious parody of fighting sports with "officials" like Bowie taking the show very seriously to the point of satire.

RELATED: David Bowie Would Have Been One of the Original Guardians of the Galaxy

Bowie explains the rules as he stands between the contestants like a referee. Bowie appeared in several movies throughout his career, sometimes in a cameo role and often as other famous people, such as Tesla in The Prestige. He actually was cast in one of the Marvel movies, but sadly, fate had other plans.

Danny DeVito - Goldmember

There are so many funny celebrity cameos in the first few minutes that it's difficult to choose one, with stars like Stephen Spielberg, Gwyneth Paltrow, and Tom Cruise all making an appearance, but we have to give this one to Danny DeVito. He plays Mini-Me in the movie within the movie that follows the opening titles and he's just as crude and outspoken as the original Mini-Me, but with his own personal rough and crass big-city charm.

DeVito appears only for a few moments, but it's long enough to chew on a fat cigar, make an obscene gesture, taunt Autin Powers and laugh maniacally. This is funny because, although it's a bit of a shock when we first see him, it fits perfectly.

Steve Carrell - Knocked Up

For those that are familiar with movies in this vein of comedy, it makes sense that Steve Carrell would appear for a cameo in Knocked Up. Katherine Heigl plays an aspiring reporter who decides to keep both her baby and her career, and in this scene, it's apparent that the two might not be integrating too well.

She tries to approach Steve Carrell for an interview at a red carpet ceremony, only to have him make rather crass jokes about her protruding baby belly. She rebukes him while at the same time aggressively pushing him for an interview, forcing Steve to face the fact that this cute pregnant lady can still hold her own.

NEXT: Avengers: Endgame Cameos Marvel Fans Missed