document_title: How I Met Your Mother

question_text: who marries ted in how i met your mother

question_tokens: who marries ted in how i met your mother

text: How I Met Your Mother

text: Premise[edit]

text: The series concerns the adventures of Ted Mosby (played by Josh Radnor) narrating the story of how he met the mother of his children. The story goes into a flashback and starts in 2005 with a 27-year-old Ted Mosby living in New York City and working as an architect; the narrative deals primarily with his best friends, including the long-lasting couple Marshall Eriksen (Jason Segel) and Lily Aldrin (Alyson Hannigan); the eccentric, womanizing-playboy Barney Stinson (Neil Patrick Harris); and news reporter Robin Scherbatsky (Cobie Smulders). The lives of all characters are entwined in each others. The series explores many storylines, including a "will they or won't they" relationship between Robin and each of the two single male friends, Marshall and Lily's relationship, and the ups and downs of the characters' careers.

text: The show's frame story depicts Ted (voice of Bob Saget, uncredited) verbally retelling the story to his son Luke (David Henrie) and daughter Penny (Lyndsy Fonseca) as they sit on the couch in the year 2030. This future-set frame is officially the show's "present day" and How I Met Your Mother exploits this framing device in numerous ways: to depict and re-depict events from multiple points of view; to set up jokes using quick and sometimes multiple flashbacks nested within the oral retelling; to substitute visual, verbal or aural euphemisms for activities Ted doesn't want to talk about with his children (sexual practices, use of illicit substances, vulgar language, etc.); and even to add some elements of humor: in the episode "How I Met Everyone Else", Ted describes his dates with a girlfriend whose name he has forgotten, leading all characters to act as though her given name were "Blah-Blah."

text: While the traditional love-story structure begins when the romantic leads first encounter each other, How I Met Your Mother does not introduce Ted's wife (Cristin Milioti) until the eighth-season finale, and only announces her name (Tracy McConnell) during the series finale. The show instead focuses on Ted's prior relationships and his dissatisfaction with those women, thus setting the stage for his eventual happiness with Tracy.

text: Production[edit]

text: How I Met Your Mother was inspired by Carter Bays and Craig Thomas's idea to "write about our friends and the stupid stuff we did in New York", where they previously worked as writers for Late Show with David Letterman, among others.[1] The two drew from their friendship in creating the characters. Ted is based loosely on Bays, and Marshall and Lily are based loosely on Thomas and his wife.[9][10] Thomas' wife Rebecca was initially reluctant to have a character based on her but agreed if they could get Alyson Hannigan to play her. Hannigan was looking to do more comedy work and was available.[9] Josh Radnor and Jason Segel, who were cast as Ted and Marshall, respectively, were not well known, though Segel had been a cast member on the short-lived Freaks and Geeks and a recurring guest star on Judd Apatow follow-up Undeclared. The role of Barney was initially envisioned as a "John Belushi-type character"[11] before Neil Patrick Harris won the role after being invited to an audition by the show's casting director Megan Branman.[12] Pamela Fryman invited Bob Saget to be the voiceover narrator, Future Ted, explaining to him that the show would be like The Wonder Years but "kind of into the future".[13] Saget either went to the television studio and recorded the narration while watching the episode, or did so separately and rerecorded with the episode if necessary.[14] He normally did not attend table readings but did so for the last episode.[15]

text: In various interviews Bays and Thomas have stated that "a pretty famous actress"[16] turned down the role of Robin, whom they revealed in February 2014 to have been Jennifer Love Hewitt.[17] They then cast Cobie Smulders for the role who, at the time, was fairly unknown. Bays and Thomas later said, "Thank God we did for a million reasons... when Ted's seeing her for the first time, America's seeing her for the first time — the intriguingness of that propelled the show going forward and kept the show alive".[16] Although Ted is initially smitten by Robin in the pilot, it is quickly established at the end of the episode that she is not the mother, which Thomas said was done so they would not copy or rehash the "will they or won't they" Ross and Rachel storyline from Friends.[10]

text: According to an Entertainment Weekly article, the writers adopted facets of each main actor's personality and incorporated them into their characters. This includes Neil Patrick Harris's skills with magic, Jason Segel's passion for songwriting, Alyson Hannigan's absent-mindedness while pregnant, and Josh Radnor's intellectualism.[18]

text: MacLaren's, an Irish bar in the middle of New York, in which some of the show is set, is loosely based on four favorite bars of Bays, Thomas and others from the Late Show staff. They include: McGee's, a Midtown tavern near the Ed Sullivan Theater where the Late Show is taped; McHale's, a legendary Hell's Kitchen bar which closed in 2006; Chumley's, a since-closed historic Greenwich Village pub; and Fez, another closed bar on the Upper West Side.[19] McGee's had a mural that Bays and Thomas both liked and wanted to incorporate into the show.[20] The name for the bar is from Carter Bays' assistant, Carl MacLaren; the bartender in the show is also named Carl.[21]

text: Episodes were generally shot over a three-day period in the Los Angeles-based Soundstage Studio 22[22] and featured upwards of 50 scenes with quick transitions and flashbacks. However, the "Pilot" episode was filmed at CBS Radford.[23] The laugh track was later created by recording an audience being shown the final edited episode. Thomas claimed that shooting before a live audience would have been impossible because of the structure of the show and the numerous flashforwards in each episode and because doing so "would blur the line between 'audience' and 'hostage situation'".[24] Later seasons started filming in front of an audience on occasion when smaller sets were used.

text: The theme song is a portion of "Hey Beautiful" by The Solids, of which Bays and Thomas are members. Episodes from Season 1 generally started with the opening credits. A cold opening has been used since Season 2. Viewers then occasionally see Ted's children on a couch and hear him talking to them, telling the story of how he met their mother. Alternatively, scenes from previous episodes or shots of New York City with Ted narrating over the top are shown. Thomas has stated that Future Ted is an unreliable narrator since he is trying to tell a story that happened over 20 years earlier;[25] this has been a plot point in several episodes including "The Goat", "Oh Honey", "How I Met Everyone Else" and "The Mermaid Theory". Nevertheless, Thomas has also emphasized maintaining a coherent and consistent universe and trying to avoid continuity errors, a problem he noticed in other shows.[26]

text: A scene relating to the identity of the mother, involving Ted's future children, was filmed in 2006 for the show's eventual series finale.[27] This was done because it was likely that the teenage actors portraying them would be adults by the time the final season was shot.[25]

text: During the 2007–2008 Writers Guild of America strike, How I Met Your Mother shut-down production; when the strike ended, the show returned on March 17, 2008, with nine new episodes.[28] The network announced a change in the timeslot to 8:30 pm ET/7:30 pm CT, flip-flopping from the summer schedule with The Big Bang Theory.[29] CBS renewed the show for a fourth season on May 14, 2008,[30] which premiered on September 22, 2008.[31]

text: In September 2008, Lifetime Television announced it had purchased the cable rerun rights to How I Met Your Mother at a rate of about $725,000 per episode.[32] The four-year syndication contract stipulated that the studio deliver at least 110 half-hour episodes by the year 2010, and allowed for up to eight seasons of the show. At the end of the fourth season only 88 episodes had been produced, and a further 22 episodes were required, ensuring that there would be a fifth season.[33] There also was a complication with the writing of the show due to the absence of actress Alyson Hannigan due to her pregnancy. The writers had to create episodes that did not include one of the five main characters.[34] On May 19, 2009, the fifth-season renewal was announced.[35] May 20, 2009, CBS announced that How I Met Your Mother would again be aired at 8 pm, leading into the new comedy Accidentally on Purpose. On January 12, 2010, the show aired its 100th episode and CBS announced that the series would return for a sixth season.[36] Upon learning that the series would be syndicated, Thomas said, "We're thrilled that it will live on in other forms," and they were proud of the show and it was great to see the strong demand.[37]

text: Reruns of the series began airing on local U.S. broadcast television stations and on Chicago-based cable superstation WGN America September 13, 2010. Featured in these airings are vanity cards previously unseen in the CBS and Lifetime airings due to marginalized credit sequences used by the two networks. Shown in between the closing credits and the production company credits, these vanity cards show portions of "The Bro Code", a list of rules frequently referenced by Harris' character, Barney Stinson, on how men should interact with each other, with an emphasis on activities involving pursuing members of the opposite sex. The opening theme song for the syndicated reruns is also slightly edited, running shorter and not using all the pictures seen in the opening montage that runs on DVD and the original CBS broadcasts. The episodes are also slightly edited, leaving out a few details.

text: One of the series' ongoing traditions involves giving guest roles to actors from various Joss Whedon productions, many of whom co-starred with Hannigan on Buffy the Vampire Slayer. Bays attributes this to their being "huge fans" and to those casts representing "a big talent pool".[38]

text: On March 4, 2011, CBS announced that the show had been renewed for two more seasons,[39] with the seventh season premiering with back-to-back episodes on September 19, 2011.[40]

text: On July 27, 2011, the FX channel announced it had picked up the series for syndication. On September 5, 2011, FX began airing the series.[41]

text: Although cast members had previously stated that the show would not run longer than eight seasons,[42] a ninth season was secured in December 2012 amidst tense negotiations with the studios and the actors – especially Jason Segel, who had wanted to move on to other ventures after the eighth season.[43][44] During these negotiations, Bays and Thomas originally approached the eighth season as if it was the show's last year, but also had a "Plan B" if the show was renewed.[45] After producers secured a ninth and final season, they implemented plans to secretly cast the titular future mother, with Cristin Milioti eventually winning the role, besting at least two other contenders.[16] Milioti first appeared in the last scene in the season eight finale "Something New" and was a regular cast member in the show's final season.[46] This marked the first time that the show had expanded its core roster.[46][47]

text: In January 2013, How I Met Your Mother was renewed for a ninth and final season.[48] Carter Bays stated to Entertainment Weekly that season nine "will feature some of the most non-linear episodes we've ever done".[49]

text: The season nine premiere episode aired on September 23, 2013 and the one-hour series finale aired on March 31, 2014.[8]

text: Cast and characters[edit]

text:
Main cast

Josh Radnor
Cobie Smulders
Neil Patrick Harris
Alyson Hannigan
Jason Segel
Cristin Milioti

Ted Mosby
Robin Scherbatsky
Barney Stinson
Lily Aldrin
Marshall Eriksen
Tracy McConnell

text:
Josh Radnor as Ted Mosby, an architect, college professor and the central character of the series. He is the main protagonist where he tells the story of his adult years from his late twenties to his early thirties and about all his obstacles he has to endure before he meets The One aka the Mother. This story is told by the Older Ted Mosby, and narrator of the series, Bob Saget. Ted moved to New York City with his friends Marshall and Lily after graduating from Wesleyan University. In New York, he met Barney at the urinal of MacLaren's and Robin, to whom he was immediately attracted. Ted is on a quest for happiness and "The One", the woman he will marry. Ted prefers more elegant and high-class interests than his friends have. He goes to great lengths to profess his love to the women in his life, but they all falter eventually. Despite these qualities, Ted often acts immaturely, such as partaking in wild activities with Barney. He meets the love of his life (the titular Mother) in the show's finale.
Jason Segel as Marshall Eriksen, Ted's best friend. In season 2 Marshall marries Lily, with whom he has been in love since his freshman year of college; they have a child during season 7. Marshall was born in St. Cloud, Minnesota. He has an interest in paranormal phenomenon, and mythical creatures, particularly Sasquatch. His dream to be an environmental lawyer conflicts with his immediate need for money, such as for his wedding and to raise his children.
Cobie Smulders as Robin Scherbatsky, a news anchor who has on-again off-again relationships with both Ted and Barney. Robin emigrated from Canada to take a job in a news station and met Ted at MacLaren's; her Canadian background is a source of many jokes from her friends. She is shown to be very career-centric and rejects traditional roles, such as getting married and having kids. Robin often drinks scotch and smokes cigars, and she is an avid gun fan. She and Barney get engaged and later marry in the first part of the series finale, but divorce in the second part, three years later.
Neil Patrick Harris as Barney Stinson is a serial playboy, using his relative wealth and an array of outrageous strategies to seduce women for sex with no intention of engaging in a relationship. His catchphrases include 'Suit Up' and 'Legend-wait-for-it-Dary'. He is Ted's "bro," often jealous of Marshall for having known Ted since college. Abandoned by his father at a young age, Barney has abandonment issues and clings to his friends. He marries Robin in the series finale but they divorce after three years. In 2020, a failed one-night stand gives him a daughter, Ellie.
Alyson Hannigan as Lily Aldrin, a kindergarten teacher, aspiring artist, and Marshall's wife. She is terrible at keeping secrets, and can be manipulative at times. She marries Marshall in season 2 and gives birth to Marvin in season 7. Though appearing sweet and cute, Lily can be quite unexpectedly fierce.
Cristin Milioti as Tracy McConnell (guest - season 8; main - season 9),[46] the future wife of Ted Mosby, The Mother. Tracy McConnell is first seen in the finale of season 8, though her name is hinted at season 1 (01x09 "Belly full of Turkey") and officially revealed in the series finale. Ted falls madly in love with her, but in 2024 she passes away.
Bob Saget as Future Ted Mosby (voice only, uncredited), Ted's future self, telling his children the story of how he met their mother, in the year 2030.

tag: ul

text: Season synopsis[edit]

text:
Season
Episodes
Originally aired

First aired
Last aired

1
22
September 19, 2005 (2005-09-19)
May 15, 2006 (2006-05-15)

2
22
September 18, 2006 (2006-09-18)
May 14, 2007 (2007-05-14)

3
20
September 24, 2007 (2007-09-24)
May 19, 2008 (2008-05-19)

4
24
September 22, 2008 (2008-09-22)
May 18, 2009 (2009-05-18)

5
24
September 21, 2009 (2009-09-21)
May 24, 2010 (2010-05-24)

6
24
September 20, 2010 (2010-09-20)
May 16, 2011 (2011-05-16)

7
24
September 19, 2011 (2011-09-19)
May 14, 2012 (2012-05-14)

8
24
September 24, 2012 (2012-09-24)
May 13, 2013 (2013-05-13)

9
24
September 23, 2013 (2013-09-23)
March 31, 2014 (2014-03-31)

text: Season 1[edit]

text: In the year 2030, Ted Mosby (voiced by Bob Saget) sits his daughter and son down to tell them the story of how he met their mother.

text: The series begins in September 2005 with Ted (Josh Radnor) as a single, 27-year-old architect living with his two best friends from his college years; Marshall Eriksen (Jason Segel), a law student, and Lily Aldrin (Alyson Hannigan), a kindergarten teacher and an aspiring artist. Lily and Marshall have been dating for almost nine years when Marshall finally proposes. Their engagement causes Ted to think about marriage and finding his soul mate, much to the disgust of his self-appointed best friend Barney Stinson (Neil Patrick Harris), whom he met in the restroom at a bar four years earlier. Barney is a serial womanizer who concocts elaborate con games, usually involving costumes and fake identities, designed to bed women, only to lose interest in them immediately afterward.

text: Ted begins his search for his perfect soul mate and meets an ambitious young reporter from Canada, Robin Scherbatsky (Cobie Smulders), with whom he quickly falls in love. Robin, however, does not want to rush into a relationship and the two decide to be friends. Future Ted reveals that Robin is not the mother after referring to her as "Aunt Robin".

text: Ted begins dating a baker, Victoria (Ashley Williams), whom he meets at Stuart and Claudia's wedding, causing Robin to become jealous, and realize she does have feelings for Ted. Victoria is offered a fellowship in pastry-making, moves to Germany and she and Ted try a long-distance relationship. Once Ted learns Robin has feelings for him, he tells her he broke up with Victoria, even though he has not. They almost have sex when Victoria calls and Robin answers, mistaking Ted's phone for her own. Ted and Victoria then break up and an angry Robin distances herself from Ted, but they eventually reconcile and decide to date.

text: Meanwhile, Lily begins to wonder if she's missed any opportunities because of her relationship with Marshall, and decides to pursue an art fellowship in San Francisco, breaking-up with Marshall in the process. The season ends with Ted returning to the apartment, the morning after spending the night with Robin for the first time, to find Marshall sitting in the rain with Lily's engagement ring, devastated by their sudden break-up.

text: Season 2[edit]

text: Ted and Robin are now a couple; meanwhile, a heartbroken Marshall tries to continue his life without Lily. After enduring numerous emotional breakdowns, Marshall's friends step in, and Barney, using sly catchphrases and pick-up lines, tries to get Marshall back in the dating game. Later, Lily, after finally realizing she is not meant to be an artist, returns to New York. They remain separated as Marshall begins to date another girl, described by the gang as having 'crazy eyes'. The date with the girl does not end well and eventually leads to Lily and Marshall becoming reunited, and their engagement eventually resumes. When Robin refuses to go to the mall or explain why, Marshall suspects she is married, and Barney suspects she has performed in adult films. They bet on it, appointing Lily as "Slap Bet Commissioner." Lily oversees the search for the truth, as they discover that Robin was a teenage pop star named "Robin Sparkles", and Marshall eventually earns the right to slap Barney five times whenever he wishes. He uses one slap immediately and another later in the season. It is revealed that Barney has a gay African American half-brother named James (Wayne Brady) and, unaware that his mother lied to him, believes that Bob Barker is his father. As a result of this he takes a trip to California to be a contestant on The Price Is Right to meet his "father". While on the show, Barney wins all the prizes and gives them to Lily and Marshall as a 'happy early wedding' present.

text: In the season finale, Ted reveals to Barney that he and Robin have been broken up for some time due to their conflicting views on marriage and children. They did not tell anyone, in order to avoid taking attention away from Lily and Marshall's wedding. The season ends with Barney's excitement at the prospect of he and Ted being single guys on the town again. Barney's final words are "this is going to be legen- wait for it...".

text: Season 3[edit]

text: Barney begins the season with the word, "-dary!" Robin returns from a trip to Argentina with her new boyfriend, Gael (Enrique Iglesias), and Ted must adjust to life as just her friend, while watching Robin and Gael fawning over each other. Marshall and Lily decide to move out on their own, falling in love with a place they cannot afford. Robin learns of Lily's bad credit rating due to her compulsive shopping for designer brands, and forces Lily to tell Marshall. Despite this, they are able to finally secure their dream apartment, only to discover it's in a bad location and more poorly constructed than they thought (the floor is tilted). Barney is slapped for the third time on Thanksgiving, which Marshall dubs "Slapsgiving."

text: Ted tells his children he met their mother through a story concerning her yellow umbrella. He finds the umbrella at a club and takes it home after attending a St. Patrick's Day party where his future wife was, although they did not meet. Ted attempts to woo Stella (Sarah Chalke), a dermatologist he sees to remove an embarrassing butterfly tattoo. This culminates in a memorable "two-minute date," which incorporates small talk, dinner, a movie, coffee, two cab rides, and a goodnight kiss, all within two minutes. Robin sleeps with Barney after he comforts her following a break-up with a past Canadian love; Ted is infuriated, and decides to stop being friends with Barney. Meanwhile, an unknown woman begins to sabotage Barney's attempts to hook up. His saboteur is revealed to be Abby (Britney Spears), Stella's receptionist, with a vendetta against him for not calling her after they had sex.

text: In the season finale, Ted gets into a car accident and ends up in hospital after breaking up with Stella. Subsequently, Barney is hit by a bus while he is on his way to visit Ted and receives treatment in the same hospital. Ted realizes Barney really cares about him and they renew their friendship. Barney's true feelings for Robin are revealed while Ted proposes to Stella in an arcade with a toy kangaroo.

text: Season 4[edit]

text: Stella says yes to Ted's proposal. Robin takes a new job in Japan, but quickly resigns and returns to New York to attend Ted's wedding, after realizing how much she misses her friends. Stella leaves Ted at the altar to get back together with Tony (Jason Jones), the father of her daughter. Barney struggles with his feelings for Robin as his company shifts him to the management team of a new acquisition, Goliath National Bank (GNB), where Marshall has accepted a position.

text: Marshall and Lily move to their new apartment and debate over whether or not they're ready to have children. Robin becomes roommates with Ted and gets a job as an anchor for a 4 AM news show after Barney submits her video resume. Ted and Robin decide to sleep together constantly so they will not fight over each other's bad co-living habits. Barney attempts to make them stop fighting to prevent this, revealing to Ted his love for Robin.

text: Ted finds out Lily has sabotaged all of his relationships with anyone she does not approve of and indirectly may have inspired his breakup with Robin. Robin and Ted end up talking about it, causing their friendship to begin moving toward a positive note. After Barney finally sleeps with his 200th woman (and rubs it in the face of the childhood bully who taunted him into pursuing it), he begins to question the purpose of the remainder of his life, leaving him more certain of his feelings for Robin.

text: Ted, while carrying the yellow umbrella, bumps into Stella and Tony. Tony later decides to visit him, sympathizing with Ted over his loss of Stella. Tony offers him a job as a professor of architecture, which Ted initially turns down.

text: In the season finale Robin finds out that Barney loves her, and initially refuses to commit to anything but a sex-only relationship; they seemingly end up together anyway. Ted decides that being an architect is leading nowhere, and finally decides instead to become a college professor. The finale ends with Ted preparing to teach his first class and Future Ted revealing to his children that one of the women in the class is their mother.

text: Season 5[edit]

text: Ted begins his job as a professor of architecture, standing in the middle of a classroom – although the mother was present, it turns out to be an economics class as he's in the wrong lecture hall. Barney and Robin have had a sexual relationship throughout the summer and Lily locks them in a room, forcing them to come to terms with their relationship. After a rough patch they decide to break up. Robin describes it instead as "two friends getting back together." Barney immediately goes back to his old ways, using the playbook to score with women. Throughout the season Barney and Robin show feelings of regret over their break-up.

text: Ted dates a graduate student named Cindy (Rachel Bilson) and it is revealed her roommate is his future wife. Robin meets Don Frank (Benjamin Koldyke), her new co-anchor on her 4 AM TV show. Though she initially dislikes him, the two start dating and eventually she moves in with him. At the end of the season they break up when Don takes a job in Chicago — a job which Robin had previously turned down to stay in New York with Don. Marshall uses his fourth slap on Barney, once again at Thanksgiving. Ted buys a house, which needs to be fixed up badly, but is later revealed to be the future home for Ted and his children.

text: Lily and Marshall are still unsure about having children. After watching four doppelgangers of their group (Lesbian Robin, Moustache Marshall, Stripper Lily and Mexican Wrestler Ted) they decide to leave the big decision to the universe's "infinite wisdom" and start trying when they have seen Barney's Doppelganger.

text: In the season finale, Barney disguises himself to have sex with a girl from every country in the world, and Lily and Marshall mistake him for the final doppelganger. When Marshall finds out, he decides not to tell Lily, fearing she will want to wait even longer to have children. Lily eventually finds out and decides to wait. In the season finale, Lily thinks she sees Barney's doppelganger as a hot dog vendor, which causes the group to realize she is seeing what she wants to see, and play along. Eventually Barney agrees having babies is not a stupid idea and Lily and Marshall should go forth. The season ends with Lily asking Marshall to "put a baby in my belly".

text: Season 6[edit]

text: In the season opening, Ted sees Cindy again with a girl who he thinks to be her roommate, but she turns out to be Cindy's girlfriend whom she later marries. After prodding by Barney, Ted is eventually hired by GNB once more as the architect of the bank's new headquarters, which was originally scrapped in Season 4. However, he encounters opposition when he meets Zoey Pierson (Jennifer Morrison), a woman who is protesting against GNB for selecting a decrepit hotel, the Arcadian, to be torn down for the headquarters. Over the season, Ted's encounters with Zoey eventually blossom into a relationship after she divorces her rich husband, the Captain (Kyle MacLachlan), but they break up as he puts his career and friends over love, leading to the Arcadian's demolition. Ted also resolves not to get back with Zoey.

text: Having agreed to conceive a baby at the end of the previous season, Lily and Marshall keep having sex, hoping she will get pregnant. Around Christmas, they have a false alarm and later seek fertility testing. The fertility specialist, Dr. Stangel, turns out to be Barney's doppelgänger, fulfilling their promise with the universe in regard to their decision to have a child. However, tragedy strikes when Marshall's father passes away, leaving him devastated and the gang comforting him. Marshall tries to get over his father's death and live again. Despite a pledge to Lily to work harder for their future, Marshall resigns from GNB and follows his dream of being an environmental lawyer. Zoey also hires him as her lawyer in what became a futile battle to save the Arcadian. At the end of the season, Lily reveals that she is pregnant.

text: Barney finally admits to the gang that Bob Barker is not his real father, especially when his mother decides to sell the house he grew up in and his brother, James, meets his own father. Loretta offers the identity of Barney's father on a sheet of paper, but Barney tears this up after realizing her efforts as a single mother. At the funeral of Marshall's father, Barney tells Loretta that he wants to see his father at last. The man, Jerry Whittaker (John Lithgow), is eventually revealed to be someone whom Barney thought was his uncle. Barney, who remembers Jerry as a fun-loving man, is disappointed after learning how Jerry has grown out of his free-wheeling ways. Although he tries to bring back Jerry's old behaviors, Barney admits that he wants to settle down someday. He is also introduced to Nora (Nazanin Boniadi), a co-worker of Robin, for whom he develops feelings. After an initial falling out, the two reconcile at the end of the season after Barney asks her for coffee.

text: Robin continues to work at her talk show, Come On, Get Up, New York!, but the presence of a new hyperactive co-host forces her to leave. She is accepted as a researcher in another network, World Wide News. The gang also discovers more of her past as the Canadian pop star Robin Sparkles. Robin also encounters a man (Michael Trucco) she has had a secret crush on since first seeing him when she and Ted were dating, and Future Ted hints that they will see more of him later.

text: Short scenes during the season premiere and finale feature a wedding set sometime in the future, where Ted will meet his future wife. In the final scene of the season, the groom is revealed to be Barney.

text: Season 7[edit]

text: Season seven opens with another flash forward, in which Ted is helping Barney get ready for his wedding to a still-unknown bride. In the present, Marshall gets a job in environmental law while Lily progresses with her pregnancy. Barney proves to Nora that he can be a good boyfriend to her, while Robin is revealed to still have feelings for Barney. Robin meets a therapist Kevin (Kal Penn) and they start to date. Meanwhile, after a period of unemployment since leaving GNB, Marshall finally manages to land his dream job at a top environmental law firm. After losing a bet, Barney is forced to wear a tie with a duck pattern on it (nicknamed the 'Ducky Tie') which he hates. Marshall allows him to take it off when meeting Nora's parents on the condition that Barney has three slaps added to the one still remaining from the Slap Bet. Marshall uses two slaps immediately, leaving two left.

text: While reminiscing about Hurricane Irene, Lily and Marshall reveal that they conceived their baby in Barney's apartment, and Barney and Robin end up sleeping together. Barney and Robin decide to break up with their partners, but Robin reneges on the deal, returning to Kevin and leaving Barney alone and heartbroken. Robin has a pregnancy scare at Thanksgiving and tells Barney the child is his, since she and Kevin had not yet slept together. However, Robin's doctor informs her that she cannot have children at all. Kevin, who wants children, proposes to Robin, who decides that they must break up. Ted comforts Robin and reveals he still loves her, but the gesture is unrequited. Eventually, she moves out to give him some space.

text: Marshall and Lily decide they want to move to Long Island, after Lily's paternal grandparents offer them their house there. Eventually, they move back to the old apartment in New York City after realizing suburban life is not for them. Ted gives them his apartment because he believes he cannot move on from Robin while living there, while he and Robin become estranged and do not speak for several weeks. Robin is eventually offered a news anchor job and subsequently achieves recognition after preventing a helicopter she is flying in from crashing.

text: Barney starts dating a stripper named Quinn, to the group's initial apprehension. The gang begins to meddle in their relationship, but Barney and Quinn outsmart their attempts and win their approval. Quinn moves in with Barney, while Ted buys Quinn's old apartment. Lily goes into labor and frantically calls Barney and Marshall, who are out at a casino. After many attempts to escape, Barney helps Marshall arrive in time for Lily's delivery and chooses the middle name for the baby, Marvin Waitforit Eriksen. Ted and Robin's friendship also recovers as a result of Marvin's birth. As the season concludes, Marshall and Lily begin their new family with their baby, Barney proposes to Quinn, and Ted contacts his old girlfriend Victoria. Unhappy with her own impending marriage, she leaves her fiancé for Ted and the pair drive off into the sunset. A final flash forward returns to the day of Barney's wedding, where Robin is revealed as the bride.

text: Season 8[edit]

text: Ted visits Robin on the day of her wedding to Barney, causing him to remember how he and Victoria ran away from her wedding to be together. The summer is spent with Ted, Barney, and Robin enjoying their current relationships; however, all subsequently break up with their partners. Victoria splits up with Ted over his friendship with Robin, Barney and Quinn break up due to their inability to trust each other, and Robin breaks up with Nick realizing his immaturity. Robin and Barney kiss but decide not to get together, despite Barney's wishes. Barney then begins dating Robin's hated co-worker Patrice (Ellen D. Williams), a relationship later exposed as a ruse to make Robin realize her true feelings for him. In a culminating scene Barney proposes to Robin, who says yes.

text: Marshall and Lily attempt to get used to being parents, which causes a brief estrangement from the gang as Baby Marvin takes up the majority of their time. Lily's father Mickey becomes Marvin's nanny, freeing the two up to spend more time with their friends. The Captain, ex-husband of Ted's old girlfriend Zoey, offers Lily a job as an art consultant after she identifies a painting that made a huge profit for him. Lily accepts, happy to finally achieve her dream of having a job in the art industry, while Marshall decides to apply to become a judge. The Captain offers Lily a year's work in Rome, which she accepts with Marshall's blessing. However, just before Barney and Robin's wedding, Marshall is informed that his application to become a judge has been granted, a development that would require them to stay in the US.

text: Ted briefly dates Jeanette (Abby Elliott), a girl who stalked him after he appeared on the cover of New York Magazine for designing GNB headquarters. He quickly realizes he's made a mistake and breaks up with her. Ted's feelings of loneliness grow, especially as he is now the only single member of the group, and he decides he is truly ready to settle down. He argues with Lily over hiring a DJ or a band for Barney and Robin's wedding, but is forced to provide a band at short notice when Lily concedes the argument. During a chance meeting on the subway, Cindy offers the services of her roommate's wedding band. This roommate is Ted's future wife.

text: As the week of the wedding approaches, Robin has doubts about marrying Barney and shares an emotional moment with Ted. Guilty, Ted realizes he can't be around Barney and Robin after they're married and decides to move to Chicago the day after the wedding. The season concludes with everyone travelling to Barney and Robin's wedding, including the mother of Ted's children (revealed on screen for the first time and portrayed by Cristin Milioti), who is seen buying a train ticket to the venue and holding her yellow umbrella.

text: Season 9[edit]

text: With the exception of the very last episode, the entirety of season nine takes place in the 56 hours leading up to Barney and Robin's wedding.

text: Marshall, who is stuck in Minnesota, desperately tries to find a way to get to the wedding in time. Meanwhile, in Farhampton, the time is slowly counting down to the wedding, with a new problem arising in almost every episode. It is revealed that Lily is pregnant and that she and Marshall will have a daughter. It was also revealed that Ted's children are named Penny and Luke. In addition, the 200th episode detailed the Mother's eight years before meeting Ted, while later episodes gave viewers a glimpse of Ted and the Mother together in flash forward scenes. Also, Marshall uses his final two slaps from the slap bet; the first being used as an apology present for missing the rehearsal dinner, and the second when Barney begins to panic just before the beginning of the wedding ceremony.

text: In the series finale, it was revealed that after three years of marriage, Barney and Robin decide to divorce. Barney ends up fathering a child during a one-night stand. Marshall eventually becomes a judge, and he and Lily have three children. Ted's wife Tracy dies of an unknown illness in 2024, six years prior to Ted telling his children the full story of how they met. Upon finishing the story, at the urging of his kids, Ted decides to ask Robin out. Alluding to the first season, the finale ends with Robin looking out her apartment window to see Ted on the street holding the blue French horn.

text: Critical reception[edit]

text: The first season was met with mixed reviews from critics, and was often compared unfavorably to Friends. The review aggregator, Rotten Tomatoes reported that 56% of critics gave the season a positive review.[50] On Metacritic, a review aggregation site that collects critical opinions, it scored a 69 out of 100.[51] Michael Abernethy of PopMatters gave the season a negative review, writing that "The comedy that does occur in How I Met Your Mother isn't enough to compensate for its inconsistencies."[52] Tom Shales of The Washington Post gave the season a lukewarm review, saying it's "a little better than most other sitcoms, past and present -- especially those featuring wacky urban friends in their twenties experiencing the bittersweet mysteries of life."[53] On the other hand, Melanie Macfarlane gave the season a positive review, saying the show "may not break any comedic ground, but it's the sort of comfortable, reliable hitter CBS needs on Monday nights."[54]

text: The second season received widespread critical acclaim.[55] Staci Krause of IGN gave the season a positive review, calling it "great".[56]

text: The third season was met with mostly positive reviews.[57] Michelle Zoromski of IGN gave the season a positive review, saying that "the season was fun and clever, a good, consistent flow from the first two seasons".[58]

text: The fourth season received critical acclaim and is generally considered the best season of the series. Michelle Zoromski of IGN gave Season 4 an overall rating of 8.5 out of 10, stating that "This fourth season seemed to settle down the chase for the titular mother. While Ted was busy dating Stella, the gang settled into many stand alone episodes which were every bit as entertaining as episodes devoted to Ted's love life". Zoromski went on to say: "A stellar Robin-Marshall episode, titled 'Little Minnesota', makes it clear that these two do not get enough screen time together. With Robin homesick and unemployed (and at risk of being deported), this pairing brought out the best Robin Sparkles reference of the season, when Marshall leads a rousing karaoke version of 'Let's Go to the Mall!'"[59]

text: The fifth season received mostly positive reviews. Cindy McLennan of Television Without Pity gave the season a mixed review, and at the end of the season wrote: "I'm okay with any given season not being primarily focused on mother-meeting, but this season, the characters seemed to regress -- particularly Barney and Ted. Usually, when a season ends, I have to deal with a week or two weeks' worth of letdown. Right now, all I'm feeling is relief."[60]

text: The sixth season received generally positive reviews.[61] Justin Fowler of Later Reviews gave the season a positive review, saying that the season was "a pretty good season of television" and better than the "poor" fifth season. He also said that "Seventeen out of the 24 episodes are what I would consider good".[62]

text: The seventh season received mixed reviews. Alan Sepinwall gave the season a mixed review and criticized the flash-forwards throughout the season, saying that "the show is just much, much stronger when its stories dwell on matters of the present or the past, and where the writers don't have to act like magicians trying to keep the audience from figuring out how the trick works. And the finale affirmed that belief for me. The parts that had little or nothing to do with things to come were quite good; the parts that were all about the future made me roll my eyes and ask, for the umpteenth time, 'Really? This is where you're going with this?'"[63]

text: The eighth season was widely criticized, with Rotten Tomatoes reporting that 40% of critics gave the show a positive review. The consensus reads: "How I Met Your Mother wears out its welcome this season, with an anticlimactic reveal and rote, less-than-fruitful humor."[64]

text: The ninth season received mixed to positive reviews. Rotten Tomatoes reported that 80% of critics gave the show a positive review, with an average rating of 7.3 out of 10. Gareth Mitchell at "House of Geekery" responded negatively, mostly criticizing the structure of the season, stating that they are "struggling to come up with stories that last out the 22 minutes".[65] The finale of the show received a polarized reaction from fans. While some complained that the last few seasons had built towards an end game that was discarded within the hour-long episode, others felt that it remained true to both the initial concept of the show and to life itself.[66]

text: Tie-ins[edit]

text: Books[edit]

text:
The Bro Code, cited by Barney many times throughout the series, is a set of written rules for bros to follow, and has been published as a tie-in novel, an audiobook,[67] an iPhone Application and an Android Application. Barney alleges it was written by Barnabus Stinson, a contemporary of George Washington and Benjamin Franklin. Many of the rules listed in this book also appear in the show's closing vanity cards in syndication.
Bro on the Go, a companion to The Bro Code, released in 2009.[68]
Bro Code for Parents: What to Expect When You're Awesome, released in 2012.[69]
The Playbook, based on the fifth season episode of the same name, by Barney Stinson and Matt Kuhn.[70]
How I Met Your Mother and Philosophy, released in 2013.[71]

text: Soundtracks[edit]

text:
A soundtrack album entitled How I Met Your Music: Original Songs from the Hit Series was released digitally to iTunes on September 24, 2012, featuring songs from the first seven seasons[72]
A second soundtrack album entitled How I Met Your Music: Deluxe was released digitally to iTunes on September 23, 2014, featuring songs from the final two seasons.[73]

text: Pineapple Incident Explained[edit]

text: After the end of the series, the officials released a short video, explaining the running mystery of the pineapple in the Pineapple Incident (season 1, episode 10). The extra footage revealed that a character revealed in the 6th season, the Captain, had put a pineapple in front of his door as a tradition and Ted took the pineapple while he was drunk.[74]

text: Proposed spin-offs[edit]

text: How I Met Your Dad[edit]

text: On November 15, 2013, it was announced that CBS and the series' producer 20th Century Fox Television would launch How I Met Your Dad, a woman-centric variation executive-produced by Bays, Thomas, and Emily Spivey.[75] The new series would possibly have featured a new bar and would not have tied into the original series.[76] The primary cast of the series was revealed to be Greta Gerwig, Drew Tarver, Nicholas D'Agosto and Andrew Santino.[77] On April 23, 2014, Meg Ryan was announced to voice future Sally.[78]

text: On May 14, 2014, CBS passed on picking up How I Met Your Dad since show creators Craig Thomas and Carter Bays did not want to reshoot the pilot.[79] Nina Tassler, the entertainment president at CBS, stated that "there were elements of the pilot that didn't work out". Talks of the series being "shopped" to other networks emerged.[79][80] Netflix, FOX and NBC were named as possible candidates for picking up the show.[81]

text: Ultimately, nothing came of those talks. It was reported that the options on the cast contracts had expired and they had been released from their contracts and co-creator Carter Bays denied any rumours that the spin-off pilot will be reshot. On July 11, 2014, Bays confirmed that the spin-off project was officially dead.[82] Six days later, Nina Tassler said that CBS would "love the opportunity to take another shot" at the pilot and that she would continue to "hound" Carter Bays and Craig Thomas – even though they shot down the idea of a new version of the project stating that they had both moved on.[83]

text: How I Met Your Father (First attempt)[edit]

text: On December 14, 2016, it was reported that Isaac Aptaker and Elizabeth Berger were set to write a new version of the previous spin-off's pilot, re-titled How I Met Your Father, with Bays and Thomas serving as executive producers.[84] On March 6, 2017, it was announced that following signing new contracts with 20th Century Fox Television that would see both Aptaker and Berger being promoted to executive producers and co-showrunners on This Is Us alongside Dan Fogelman, their completed spec script for How I Met Your Father would be placed on the back burner in light of their new duties.[85] The idea was later completely abandoned.

text: How I Met Your Father (Second attempt)[edit]

text: On August 8, 2017, Fox chairman Dana Walden told Deadline that the studio was set to try a third spin-off with different writers. It was also stated that all ideas from the previous two attempts will not be carried over and the new attempt will be created from scratch.[86] On August 11, 2017, Deadline reported that Alison Bennett had been selected to write the spin-off. It was also confirmed that this incarnation would be developed under the title used for the Aptaker and Berger project, and that Bays and Thomas are once again attached as executive producers.[87]

text: Russian adaptation[edit]

text: The GoodStoryMedia, a Russian production company, made a remake of the series which was broadcast on STS and ran for two seasons.[88]

text: Nielsen ratings[edit]

text: The show's highest viewed episode was the series finale, "Last Forever", watched by 13.13 million viewers.[89] Previously, the most viewed episode was the season 1 episode "The Pineapple Incident", watched by 12.3 million viewers. The lowest-viewed episode was the season 6 episode "Landmarks", watched by 6.4 million viewers, approximately 52% of the show's series high.

text: Season nine was the highest watched season overall and among the 18-49 adults, scoring a 4.5 rating in that sector[90] up from the second-highest rating of 4.1 in season seven.[91]

text:
Season
Timeslot (ET)
Season premiere
Season finale
TV season
Rank
Avg. viewers
(in millions)

1
Monday 8:30 P.M.
September 19, 2005
May 15, 2006
2005–2006
54[92]
9.47[92]

2
Monday 8:30 P.M.
(Episodes 1–3)
Monday 8:00 P.M.
(Episodes 4–22)
September 18, 2006
May 14, 2007
2006–2007
61[93]
8.94[93]

3
Monday 8:00 P.M.
(Episodes 1–11)
Monday 8:30 P.M.
(Episodes 12–20)
September 24, 2007
May 19, 2008
2007–2008
70[94]
8.21[94]

4
Monday 8:30 P.M.
September 22, 2008
May 18, 2009
2008–2009
49[95]
9.42[95]

5
Monday 8:00 P.M.
September 21, 2009
May 24, 2010
2009–2010
42[96]
8.60[96]

6
September 20, 2010
May 16, 2011
2010–2011
48
8.79[97]

7
September 19, 2011
May 14, 2012
2011–2012
45[91]
9.67[91]

8
September 24, 2012
May 13, 2013
2012–2013
42
9.02[98]

9
September 23, 2013
March 31, 2014
2013–2014
28[90]
10.51[90]

text: Awards and nominations[edit]

text:
Awards & nominations

Award
Won
Nominated

ALMA Awards

1
2

Art Directors Guild

0
7

Casting Society of America

0
1

Critics' Choice Television Awards

1
1

Emmy Awards

9
28

EWwy Awards

1
1

GLAAD Media Awards

0
1

Golden Globe Awards

0
2

People's Choice Awards

6
17

PRISM Awards

0
1

Satellite Awards

0
4

TCA Awards

0
2

Teen Choice Awards

0
4

Young Hollywood Awards

0
1

Total number of wins and nominations

Totals
18
72

text: The show has been nominated for 72 awards, winning 18. The show has been nominated for 28 Emmy Awards, including a nomination for Outstanding Comedy Series. Stars Alyson Hannigan and Neil Patrick Harris have each received acting accolades, with both receiving People's Choice Awards, and Harris receiving Emmy and Golden Globe nominations. In 2012, seven years after its premiere, the series won the People's Choice for Favorite Network TV Comedy. The show's art direction, editing and cinematography have also been awarded.

text: DVD releases[edit]

text:
DVD season
Release dates
Episodes
Additional information

Region 1
Region 2
Region 4

Season 1
November 21, 2006
May 7, 2007
January 10, 2007
22

Includes:

commentaries on six episodes
a video yearbook
2 music videos ("First Round" and "Last Call")
a gag reel

Episodes have been cropped from the broadcast widescreen to a full frame 4:3 format

Season 2
October 2, 2007
February 8, 2010
April 8, 2008
22

Includes:

commentaries on seven episodes
How We Make Your Mother
2 music videos ("Let's Go To The Mall" and "Hey Beautiful")
3 "How It Really Happened" scenes
a gag reel
an Easter Egg.

The Legendary Season 3
October 7, 2008
May 10, 2010
February 11, 2009
20

Includes:

commentaries on 7 episodes
a series retrospective
Lily & Marshall's honeymoon videos
cast favorites
a behind the scenes of "We're Not From Here"
6 "How It Really Happened" scenes
2 music videos ("You Just Got Slapped" and "Sandcastles in the Sand")
"Ted Mosby Is A Jerk" audio track
a gag reel.

The Awesome Season 4
September 29, 2009
July 19, 2010
October 27, 2009
24

Includes:

commentaries on 4 episodes
A Night With Your Mother: Academy of Television Arts & Sciences Panel Discussion
season recap
Eriksen's Fight Club
a music video ("That Guy's Awesome")
a gag reel

Also available on Blu-Ray, and is the only season to have a subsequent Blu Ray release.

The Complete Season 5. The Suited-Up Edition
September 21, 2010
November 8, 2010
October 27, 2010
24

Includes:

a gag reel
music videos for "Super Date", "Nothing Suits Me Like a Suit", and "Best Night Ever"
2 behind the scenes features
making of "Super Date"
behind the scenes of the 100th episode
an extended version of the "Wedding Bride" trailer
a musical series recap.

The Complete Season 6. The New Is Always Better Edition
September 27, 2011
October 3, 2011
October 5, 2011
24

Includes:

a gag reel
making of "Subway Wars"
behind the scenes of "Glitter"
commentaries on 3 episodes
an extended performance of "Stand By Me"
a season recap[99]

The Complete Season 7. The Ducky Tie Edition
October 2, 2012
October 15, 2012
October 10, 2012
24

Includes:

a gag reel
2 behind the scenes featurettes
deleted scenes
audio commentaries on 3 episodes
a feature on Neil Patrick Harris' Hollywood Walk of Fame star.[100]

The Complete Season 8. The Yellow Umbrella Edition
October 1, 2013
September 30, 2013
November 9, 2013
24

Includes:

deleted scenes
audio commentary on "Farmhampton" and "The Final Page"
music video for "PS I Love You"
making of "PS I Love You"
Where We Make Your Mother: Set Tour
a gag reel.

The 9th and Legendary Final Season. The Rest of Your Life Edition[101]
September 23, 2014
October 13, 2014
October 22, 2014
24

Includes:

Deleted Scenes
Audio Commentary on "The Locket"
Audio Commentary on "The Rehearsal Dinner"
Audio Commentary on "How Your Mother Met Me"
Last Forever Alternate Ending
How It All Ends
Cristin Milioti Audition
Behind the Scenes of "Gary Blauman"
Gag Reel[101]

The Whole Story Seasons 1–9[101]
September 23, 2014
October 13, 2014
October 22, 2014
208

Includes:

All Out of Spoilers: Looking Back at Your Mother – A Retrospective
Table Read of the Series Finale with the Entire Cast
The Secret of the Pineapple Incident Revealed
Meeting the Mother
How I Met Your Mother at Comic-Con 2013-2014
The Mosby Kids: 8 Years on the Couch
How We Filmed the Kids
Plus All the Special Features from Every Previous Season[101]

text: Seasons 1 through 9 are available to stream on Netflix in Australia, Latin America, Spain, the UK, Ireland, the US and Canada; season 9 was released on September 26, 2014.[102][103]

text: Note: The whole story DVD had a different package in Region 1 as opposed to Region 2 + 4


document_title: Marla Adams

question_text: who plays dina bergeron on the young and the restless

root

text: Marla Adams

text:
Marla Adams

Born
(1938-08-28) August 28, 1938 (age 79)
Ocean City, New Jersey, U.S.

Occupation
Actress

Years active
1961–present

tag: table

text: Marla Adams (born August 28, 1938; Ocean City, New Jersey) is an American television actress, best known for her roles as Belle Clemens on The Secret Storm, from 1968 to 1974,[1] and as Dina Abbott Mergeron on The Young and the Restless. As Belle Clemens, she was the show's reigning villainess for the last years of its run, stopping at almost nothing to destroy the life of the show's leading heroine, Amy Ames. Like Vicky and Dorian later on One Life to Live, the two rivals were at one time related through marriage. As Dina Abbott on The Young and the Restless from 1983 to 1986, in 1991 and again in 1996, she caused major disruptions in the lives of her three children and ex-husband John Abbott and his wife Jill. She reprised her role as Dina for three episodes on The Young and the Restless in 2008 when Katharine Chancellor was presumed dead. In May 2017, Adams returned to The Young and the Restless.[2]

tag: p

text: Right before joining The Young and the Restless, she stepped into the role of the scheming Myrna Clegg, on the defunct daytime drama Capitol after the departure of actress Carolyn Jones who had left for health reasons, prior to Marj Dusay, who remained until the end of the show's run. As Helen Mullin on Generations, she was involved in a storyline involving racism, although it was her character's husband, Charles, who was the racist even though he was revealed to have a black mistress. She was the third actress to play Beth Logan, Brooke (Katherine Kelly Lang), Donna (Carrie Mitchum, now Jennifer Gareis), and Katie's (Nancy Sloan, now Heather Tom) mother on The Bold and the Beautiful (1991). In 1999, she appeared on Days of Our Lives as snooty Dr. Claire McIntyre.

text: Adams appeared on Broadway in the 1958 production of "The Visit" at the Morosco Theatre with Alfred Lunt and Lynn Fontanne.

text: Filmography[edit]

text:
Years
Title
Role
Notes

1961
Splendor in the Grass
June

1968–1974
Secret Storm, TheThe Secret Storm
Belle Clemens Britton Kincaid[3]

1983
The Young and the Restless
Dina Abbott Mergeron[4]
Recurring role; 1983–1986, 1991, 1996, 2008, 2017–

1985
Gotcha!
Maria Moore[5]

1989-1990
Generations
Helen Mullin

1991
The Bold and the Beautiful
Beth Logan


document_title: PHP

question_text: what is the current version of php and mysql

question_tokens: what is the current version of php and mysql

text: PHP

text: History[edit]

text: Early history[edit]

text: PHP development began in 1995 when Rasmus Lerdorf wrote several Common Gateway Interface (CGI) programs in C,[10][11][12] which he used to maintain his personal homepage. He extended them to work with web forms and to communicate with databases, and called this implementation "Personal Home Page/Forms Interpreter" or PHP/FI.

text: PHP/FI could help to build simple, dynamic web applications. To accelerate bug reporting and to improve the code, Lerdorf initially announced the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0" on the Usenet discussion group comp.infosystems.www.authoring.cgi on June 8, 1995.[13][14] This release already had the basic functionality that PHP has as of 2013[update]. This included Perl-like variables, form handling, and the ability to embed HTML. The syntax resembled that of Perl but was simpler, more limited and less consistent.[5]

text: Lerdorf did not intend the early PHP to become a new programming language, but it grew organically, with Lerdorf noting in retrospect: "I don’t know how to stop it, there was never any intent to write a programming language […] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way."[15] A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997.

text: The fact that PHP lacked an original overall design but instead developed organically has led to inconsistent naming of functions and inconsistent ordering of their parameters.[16] In some cases, the function names were chosen to match the lower-level libraries which PHP was "wrapping",[17] while in some very early versions of PHP the length of the function names was used internally as a hash function, so names were chosen to improve the distribution of hash values.[18]

text: PHP 3 and 4[edit]

text: PHP 3.0 is the successor of PHP/FI 2.0[19]. Zeev Suraski and Andi Gutmans rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive acronym PHP: Hypertext Preprocessor.[5][20] Afterwards, public testing of PHP 3 began, and the official launch came in June 1998[21]. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999.[22] They also founded Zend Technologies in Ramat Gan, Israel.[5]

text: On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released.[5] As of August 2008 this branch reached version 4.4.9. PHP 4 is no longer under development nor will any security updates be released.[23][24]

text: PHP 5[edit]

text: On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II.[5] PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.[25] In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.[26][27]

text: Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the GoPHP5 initiative,[28] provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.[29][30]

text: Over time, PHP interpreters became available on most existing 32-bit and 64-bit operating systems, either by building them from the PHP source code, or by using pre-built binaries.[31] For the PHP versions 5.3 and 5.4, the only available Microsoft Windows binary distributions were 32-bit x86 builds,[32][33] requiring Windows 32-bit compatibility mode while using Internet Information Services (IIS) on a 64-bit Windows platform. PHP version 5.5 made the 64-bit x86-64 builds available for Microsoft Windows.[34]

text: PHP 6 and Unicode[edit]

text: PHP has received criticism due to lacking native Unicode support at the core language level, instead only supporting byte strings. In 2005, a project headed by Andrei Zmievski was initiated to bring native Unicode support throughout PHP, by embedding the International Components for Unicode (ICU) library, and representing text strings as UTF-16 internally.[35] Since this would cause major changes both to the internals of the language and to user code, it was planned to release this as version 6.0 of the language, along with other major features then in development.[36]

text: However, a shortage of developers who understood the necessary changes, and performance problems arising from conversion to and from UTF-16, which is rarely used in a web context, led to delays in the project.[37] As a result, a PHP 5.3 release was created in 2009, with many non-Unicode features back-ported from PHP 6, notably namespaces. In March 2010, the project in its current form was officially abandoned, and a PHP 5.4 release was prepared containing most remaining non-Unicode features from PHP 6, such as traits and closure re-binding.[38] Initial hopes were that a new plan would be formed for Unicode integration, but as of 2014 none had been adopted.

text: PHP 7[edit]

text: During 2014 and 2015, a new major PHP version was developed, which was numbered PHP 7. The numbering of this version involved some debate.[39] While the PHP 6 Unicode experiment had never been released, several articles and book titles referenced the PHP 6 name, which might have caused confusion if a new release were to reuse the name.[40] After a vote, the name PHP 7 was chosen.[41]

text: The foundation of PHP 7 is a PHP branch that was originally dubbed PHP next generation (phpng). It was authored by Dmitry Stogov, Xinchen Hui and Nikita Popov,[42] and aimed to optimize PHP performance by refactoring the Zend Engine to use more compact data structures with improved cache locality while retaining near-complete language compatibility.[43] As of 14 July 2014[update], WordPress-based benchmarks, which served as the main benchmark suite for the phpng project, showed an almost 100% increase in performance. Changes from phpng are also expected to make it easier to improve performance in the future, as more compact data structures and other changes are seen as better suited for a successful migration to a just-in-time (JIT) compiler.[44] Because of the significant changes, the reworked Zend Engine is called Zend Engine 3, succeeding Zend Engine 2 used in PHP 5.[45]

text: Because of major internal changes in phpng, it must receive a new major version number of PHP, rather than a minor PHP 5 release, according to PHP's release process.[46] Major versions of PHP are allowed to break backward-compatibility of code and therefore PHP 7 presented an opportunity for other improvements beyond phpng that require backward-compatibility breaks, including wider use of exceptions,[47][48] reworking variable syntax to be more consistent and complete,[49] and the deprecation or removal of various legacy features.[50][51]

text: PHP 7 also introduced new language features, including return type declarations for functions,[52] which complement the existing parameter type declarations, and support for the scalar types (integer, float, string, and boolean) in parameter and return type declarations.[53]

text: Release history[edit]

text:
Key

Color
Meaning
Development

Red
Old release
No development

Yellow
Stable release
Security fixes

Green
Stable release
Bug and security fixes

Blue
Future release
New features

text:
Version
Latest[54]
Release date
Supported until[55]
Notes

1.0
1.0.8
8 June 1995

Officially called "Personal Home Page Tools (PHP Tools)". This is the first use of the name "PHP".[5]

2.0
2.0.1
1 November 1997

Officially called "PHP/FI 2.0". This is the first release that could actually be characterised as PHP, being a standalone language with many features that have endured to the present day.

3.0
3.0.18
6 June 1998
20 October 2000[55]
Development moves from one person to multiple developers. Zeev Suraski and Andi Gutmans rewrite the base for this version.[5]

4.0
4.0.6
22 May 2000
23 June 2001[55]
Added more advanced two-stage parse/execute tag-parsing system called the Zend engine.[56]

4.1
4.1.2
10 December 2001
12 March 2002[55]
Introduced "superglobals" ($_GET, $_POST, $_SESSION, etc.)[56]

4.2
4.2.3
22 April 2002
6 September 2002[55]
Disabled register_globals by default. Data received over the network is not inserted directly into the global namespace anymore, closing possible security holes in applications.[56]

4.3
4.3.11
27 December 2002
31 March 2005[55]
Introduced the command-line interface (CLI), to supplement the CGI.[56][57]

4.4
4.4.9
11 July 2005
7 August 2008[55]
Fixed a memory corruption bug, which required breaking binary compatibility with extensions compiled against PHP version 4.3.x.[58]

5.0
5.0.5
13 July 2004
5 September 2005[55]
Zend Engine II with a new object model.[59]

5.1
5.1.6
24 November 2005
24 August 2006[55]
Performance improvements with introduction of compiler variables in re-engineered PHP Engine.[59] Added PHP Data Objects (PDO) as a consistent interface for accessing databases.[60]

5.2
5.2.17
2 November 2006
6 January 2011[55]
Enabled the filter extension by default. Native JSON support.[59]

5.3
5.3.29
30 June 2009
14 August 2014[55]
Namespace support; late static bindings, jump label (limited goto), closures, PHP archives (phar), garbage collection for circular references, improved Windows support, sqlite3, mysqlnd as a replacement for libmysql as underlying library for the extensions that work with MySQL, fileinfo as a replacement for mime_magic for better MIME support, the Internationalization extension, and deprecation of ereg extension.

5.4
5.4.45
1 March 2012
3 September 2015[55]
Trait support, short array syntax support. Removed items: register_globals, safe_mode, allow_call_time_pass_reference, session_register(), session_unregister() and session_is_registered(). Built-in web server.[61] Several improvements to existing features, performance and reduced memory requirements.

5.5
5.5.38
20 June 2013
21 July 2016[55]
Support for generators, finally blocks for exceptions handling, OpCache (based on Zend Optimizer+) bundled in official distribution.[62]

5.6
5.6.32
28 August 2014
31 December 2018[63]
Constant scalar expressions, variadic functions, argument unpacking, new exponentiation operator, extensions of the use statement for functions and constants, new phpdbg debugger as a SAPI module, and other smaller improvements.[64]

6.x
N/A
Not released
N/A
Abandoned version of PHP that planned to include native Unicode support.[65][66]

7.0
7.0.25
3 December 2015[2]
3 December 2018[63]
Zend Engine 3 (performance improvements[44] and 64-bit integer support on Windows[67]), uniform variable syntax,[49] AST-based compilation process,[68] added Closure::call(),[69] bitwise shift consistency across platforms,[70] ?? (null coalesce) operator,[71] Unicode codepoint escape sequence,[72] return type declarations,[52] scalar type (integer, float, string and boolean) declarations,[53] <=> "spaceship" three-way comparison operator,[73] generator delegation,[74] anonymous classes,[75] simpler and more consistently available CSPRNG API,[76] replacement of many remaining internal PHP "errors" with the more modern exceptions,[47] and shorthand syntax for importing multiple items from a namespace.[77]

7.1
7.1.11
1 December 2016[78][79]
1 December 2019[63]
void return type,[80] class constant visibility modifiers,[81] nullable types,[82] iterable pseudo-type,[83] catching multiple exception types.[84]

7.2
7.2.0 RC 5
30 November 2017[85]
30 November 2020[63]

text: Beginning on June 28, 2011, the PHP Group implemented a timeline for the release of new versions of PHP.[46] Under this system, at least one release should occur every month. Once per year, a minor release should occur which may include new features. Every minor release should at least be supported for two years with security and bug fixes, followed by at least one year of only security fixes, for a total of a three-year release process for every minor release. No new features, unless small and self-contained, are to be introduced into a minor release during the three-year release process.

text: Mascot[edit]

text: The mascot of the PHP project is the elePHPant, a blue elephant with the PHP logo on its side, designed by Vincent Pontier[86] in 1998.[87] The elePHPant is sometimes differently colored when in plush toy form.

text: Syntax[edit]

text: The following "Hello, World!" program is written in PHP code embedded in an HTML document:

text: However, as no requirement exists for PHP code to be embedded in HTML, the simplest version of Hello World may be written like this, with the closing tag omitted as preferred in files containing pure PHP code[88]

text: The PHP interpreter only executes PHP code within its delimiters. Anything outside its delimiters is not processed by PHP, although non-PHP text is still subject to control structures described in PHP code. The most common delimiters are <?php to open and ?> to close PHP sections. The shortened form <? also exists. This short delimiter makes script files less portable, since support for them can be disabled in the local PHP configuration and it is therefore discouraged.[89][90] However, there is no recommendation against the use of the echo short tag <?=.[91] Prior to PHP 5.4.0, this short syntax for echo() only works with the short_open_tag configuration setting enabled, while for PHP 5.4.0 and later it is always available.[89][92][93] The purpose of all these delimiters is to separate PHP code from non-PHP content, such as JavaScript code or HTML markup.[94]

text: The first form of delimiters, <?php and ?>, in XHTML and other XML documents, creates correctly formed XML processing instructions.[95] This means that the resulting mixture of PHP code and other markup in the server-side file is itself well-formed XML.

text: Variables are prefixed with a dollar symbol, and a type does not need to be specified in advance. PHP 5 introduced type hinting that allows functions to force their parameters to be objects of a specific class, arrays, interfaces or callback functions. However, before PHP 7.0, type hints could not be used with scalar types such as integer or string.[53]

text: Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and heredoc strings provide the ability to interpolate a variable's value into the string.[96] PHP treats newlines as whitespace in the manner of a free-form language, and statements are terminated by a semicolon.[97] PHP has three types of comment syntax: /* */ marks block and inline comments; // as well as # are used for one-line comments.[98] The echo statement is one of several facilities PHP provides to output text, e.g., to a web browser.

text: In terms of keywords and language syntax, PHP is similar to the C style syntax. if conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, C#, Java and Perl.

text: The following is an example of PHP for loop:

text: Data types[edit]

text: PHP stores integers in a platform-dependent range, either a 64-bit or 32-bit signed integer equivalent to the C-language long type. Unsigned integers are converted to signed values in certain situations; this behavior is different from that of other programming languages.[99] Integer variables can be assigned using decimal (positive and negative), octal, hexadecimal, and binary notations.

text: Floating point numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation.[100] PHP has a native Boolean type that is similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as in Perl and C++.[100]

text: The null data type represents a variable that has no value; NULL is the only allowed value for this data type.[100]

text: Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension; examples include file, image, and database resources.[100]

text: Arrays can contain elements of any type that PHP can handle, including resources, objects, and other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled.[100] PHP also supports strings, which can be used with single quotes, double quotes, nowdoc or heredoc syntax.[101]

text: The Standard PHP Library (SPL) attempts to solve standard problems and implements efficient data access interfaces and classes.[102]

text: Functions[edit]

text: PHP defines a large array of functions in the core language and many are also available in various extensions; these functions are well documented in the online PHP documentation.[103] However, the built-in library has a wide variety of naming conventions and associated inconsistencies, as described under history above.

text: Custom functions may be defined by the developer, e.g.:

text: In 2017, the output of the above sample program is 'I am currently 36 years old.'

text: In lieu of function pointers, functions in PHP can be referenced by a string containing their name. In this manner, normal PHP functions can be used, for example, as callbacks or within function tables.[104] User-defined functions may be created at any time without being prototyped.[103][104] Functions may be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. There is a function_exists function that determines whether a function with a given name has already been defined. Function calls must use parentheses, with the exception of zero-argument class constructor functions called with the PHP operator new, in which case parentheses are optional.

text: Until PHP 5.3, support for anonymous functions and closures did not exist in PHP. While create_function() exists since PHP 4.0.1, it is merely a thin wrapper around eval() that allows normal PHP functions to be created during program execution.[105] PHP 5.3 added syntax to define an anonymous function or "closure"[106] which can capture variables from the surrounding scope:

text: In the example above, getAdder() function creates a closure using passed argument $x (the keyword use imports a variable from the lexical context), which takes an additional argument $y, and returns the created closure to the caller. Such a function is a first-class object, meaning that it can be stored in a variable, passed as a parameter to other functions, etc.[107]

text: Unusually for a dynamically typed language, PHP supports type declarations on function parameters, which are enforced at runtime. This has been supported for classes and interfaces since PHP 5.0, for arrays since PHP 5.1, for "callables" since PHP 5.4, and scalar (integer, float, string and boolean) types since PHP 7.0.[53] PHP 7.0 also has type declarations for function return types, expressed by placing the type name after the list of parameters, preceded by a colon.[52] For example, the getAdder function from the earlier example could be annotated with types like so in PHP 7:

text: By default, scalar type declarations follow weak typing principles. So, for example, if a parameter's type is int, PHP would allow not only integers, but also convertible numeric strings, floats or booleans to be passed to that function, and would convert them.[53] However, PHP 7 has a "strict typing" mode which, when used, disallows such conversions for function calls and returns within a file.[53]

text: Object-oriented programming[edit]

text: Basic object-oriented programming functionality was added in PHP 3 and improved in PHP 4.[5] This allowed for PHP to gain further abstraction, making creative tasks easier for programmers using the language. Object handling was completely rewritten for PHP 5, expanding the feature set and enhancing performance.[108] In previous versions of PHP, objects were handled like value types.[108] The drawback of this method was that code had to make heavy use of PHP's "reference" variables if it wanted to modify an object it was passed rather than creating a copy of it. In the new approach, objects are referenced by handle, and not by value.

text: PHP 5 introduced private and protected member variables and methods, along with abstract classes, final classes, abstract methods, and final methods. It also introduced a standard way of declaring constructors and destructors, similar to that of other object-oriented languages such as C++, and a standard exception handling model. Furthermore, PHP 5 added interfaces and allowed for multiple interfaces to be implemented. There are special interfaces that allow objects to interact with the runtime system. Objects implementing ArrayAccess can be used with array syntax and objects implementing Iterator or IteratorAggregate can be used with the foreach language construct. There is no virtual table feature in the engine, so static variables are bound with a name instead of a reference at compile time.[109]

text: If the developer creates a copy of an object using the reserved word clone, the Zend engine will check whether a __clone() method has been defined. If not, it will call a default __clone() which will copy the object's properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports the properties of the source object, so the programmer can start with a by-value replica of the source object and only override properties that need to be changed.[110]

text: The following is a basic example of object-oriented programming in PHP:

text: The visibility of PHP properties and methods is defined using the keywords public, private, and protected. The default is public, if only var is used; var is a synonym for public. Items declared public can be accessed everywhere. protected limits access to inherited classes (and to the class that defines the item). private limits visibility only to the class that defines the item.[111] Objects of the same type have access to each other's private and protected members even though they are not the same instance. PHP's member visibility features have sometimes been described as "highly useful."[112] However, they have also sometimes been described as "at best irrelevant and at worst positively harmful."[113]

text: Implementations[edit]

text: The original, only complete and most widely used PHP implementation is powered by the Zend Engine and known simply as PHP. To disambiguate it from other implementations, it is sometimes unofficially referred to as "Zend PHP". The Zend Engine compiles PHP source code on-the-fly into an internal format that it can execute, thus it works as an interpreter.[114][115] It is also the "reference implementation" of PHP, as PHP has no formal specification, and so the semantics of Zend PHP define the semantics of PHP itself. Due to the complex and nuanced semantics of PHP, defined by how Zend works, it is difficult for competing implementations to offer complete compatibility.

text: PHP's single-request-per-script-execution model, and the fact that the Zend Engine is an interpreter, leads to inefficiency; as a result, various products have been developed to help improve PHP performance. In order to speed up execution time and not have to compile the PHP source code every time the web page is accessed, PHP scripts can also be deployed in the PHP engine's internal format by using an opcode cache, which works by caching the compiled form of a PHP script (opcodes) in shared memory to avoid the overhead of parsing and compiling the code every time the script runs. An opcode cache, Zend Opcache, is built into PHP since version 5.5.[116] Another example of a widely used opcode cache is the Alternative PHP Cache (APC), which is available as a PECL extension.[117]

text: While Zend PHP is still the most popular implementation, several other implementations have been developed. Some of these are compilers or support JIT compilation, and hence offer performance benefits over Zend PHP at the expense of lacking full PHP compatibility. Alternative implementations include the following:

text:
HipHop Virtual Machine (HHVM) –  developed at Facebook and available as open source, it converts PHP code into a high-level bytecode (commonly known as an intermediate language), which is then translated into x86-64 machine code dynamically at runtime by a just-in-time (JIT) compiler, resulting in up to 6× performance improvements.[118]
Parrot –  a virtual machine designed to run dynamic languages efficiently; Pipp transforms the PHP source code into the Parrot intermediate representation, which is then translated into the Parrot's bytecode and executed by the virtual machine.
Phalanger –  compiles PHP into Common Intermediate Language (CIL) bytecode
HipHop –  developed at Facebook and available as open source, it transforms the PHP scripts into C++ code and then compiles the resulting code, reducing the server load up to 50%. In early 2013, Facebook deprecated it in favor of HHVM due to multiple reasons, including deployment difficulties and lack of support for the whole PHP language, including the create_function() and eval() constructs.[119]

text: Licensing[edit]

text: PHP is free software released under the PHP License, which stipulates that:[120]

text: Products derived from this software may not be called "PHP", nor may "PHP" appear in their name, without prior written permission from group@php.net. You may indicate that your software works in conjunction with PHP by saying "Foo for PHP" instead of calling it "PHP Foo" or "phpfoo".

text: This restriction on use of "PHP" makes the PHP License incompatible with the General Public License (GPL), while the Zend License is incompatible due to an advertising clause similar to that of the original BSD license.[121]

text: Development and community[edit]

text: PHP includes various free and open-source libraries in its source distribution, or uses them in resulting PHP binary builds. PHP is fundamentally an Internet-aware system with built-in modules for accessing File Transfer Protocol (FTP) servers and many database servers, including PostgreSQL, MySQL, Microsoft SQL Server and SQLite (which is an embedded database), LDAP servers, and others. Numerous functions familiar to C programmers, such as those in the stdio family, are available in standard PHP builds.[122]

text: PHP allows developers to write extensions in C to add functionality to the PHP language. PHP extensions can be compiled statically into PHP or loaded dynamically at runtime. Numerous extensions have been written to add support for the Windows API, process management on Unix-like operating systems, multibyte strings (Unicode), cURL, and several popular compression formats. Other PHP features made available through extensions include integration with IRC, dynamic generation of images and Adobe Flash content, PHP Data Objects (PDO) as an abstraction layer used for accessing databases,[123][124][125][126][127][128][129] and even speech synthesis. Some of the language's core functions, such as those dealing with strings and arrays, are also implemented as extensions.[130] The PHP Extension Community Library (PECL) project is a repository for extensions to the PHP language.[131]

text: Some other projects, such as Zephir, provide the ability for PHP extensions to be created in a high-level language and compiled into native PHP extensions. Such an approach, instead of writing PHP extensions directly in C, simplifies the development of extensions and reduces the time required for programming and testing.[132]

text: The PHP Group consists of ten people (as of 2015[update]): Thies C. Arntzen, Stig Bakken, Shane Caraveo, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski.[133]

text: Zend Technologies provides a PHP Certification based on PHP 5.5[134] exam for programmers to become certified PHP developers.

text: Installation and configuration[edit]

text: There are two primary ways for adding support for PHP to a web server –  as a native web server module, or as a CGI executable. PHP has a direct module interface called Server Application Programming Interface (SAPI), which is supported by many web servers including Apache HTTP Server, Microsoft IIS, Netscape (now defunct) and iPlanet. Some other web servers, such as OmniHTTPd, support the Internet Server Application Programming Interface (ISAPI), which is a Microsoft's web server module interface. If PHP has no module support for a web server, it can always be used as a Common Gateway Interface (CGI) or FastCGI processor; in that case, the web server is configured to use PHP's CGI executable to process all requests to PHP files.[135]

text: PHP-FPM (FastCGI Process Manager) is an alternative FastCGI implementation for PHP, bundled with the official PHP distribution since version 5.3.3.[136] When compared to the older FastCGI implementation, it contains some additional features, mostly useful for heavily loaded web servers.[137]

text: When using PHP for command-line scripting, a PHP command-line interface (CLI) executable is needed. PHP supports a CLI SAPI as of PHP 4.3.0.[138] The main focus of this SAPI is developing shell applications using PHP. There are quite a few differences between the CLI SAPI and other SAPIs, although they do share many of the same behaviors.[139]

text: PHP has a direct module interface called SAPI for different web servers;[140] in case of PHP 5 and Apache 2.0 on Windows, it is provided in form of a DLL file called php5apache2.dll,[141] which is a module that, among other functions, provides an interface between PHP and the web server, implemented in a form that the server understands. This form is what is known as a SAPI.

text: There are different kinds of SAPIs for various web server extensions. For example, in addition to those listed above, other SAPIs for the PHP language include the Common Gateway Interface (CGI) and command-line interface (CLI).[140][142]

text: PHP can also be used for writing desktop graphical user interface (GUI) applications, by using the PHP-GTK extension. PHP-GTK is not included in the official PHP distribution,[135] and as an extension it can be used only with PHP versions 5.1.0 and newer. The most common way of installing PHP-GTK is compiling it from the source code.[143]

text: When PHP is installed and used in cloud environments, software development kits (SDKs) are provided for using cloud-specific features. For example:

text:
Amazon Web Services provides the AWS SDK for PHP[144]
Windows Azure can be used with the Windows Azure SDK for PHP.[145]

text: Numerous configuration options are supported, affecting both core PHP features and extensions.[146][147] Configuration file php.ini is searched for in different locations, depending on the way PHP is used.[148] The configuration file is split into various sections,[149] while some of the configuration options can be also set within the web server configuration.[150]

text: Use[edit]

text: PHP is a general-purpose scripting language that is especially suited to server-side web development, in which case PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content or dynamic images used on websites or elsewhere.[151] It can also be used for command-line scripting and client-side graphical user interface (GUI) applications. PHP can be deployed on most web servers, many operating systems and platforms, and can be used with many relational database management systems (RDBMS). Most web hosting providers support PHP for use by their clients. It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.[8]

text: PHP acts primarily as a filter,[152] taking input from a file or stream containing text and/or PHP instructions and outputting another stream of data. Most commonly the output will be HTML, although it could be JSON, XML or binary data such as image or audio formats. Since PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor.[153]

text: Originally designed to create dynamic web pages, PHP now focuses mainly on server-side scripting,[154] and it is similar to other server-side scripting languages that provide dynamic content from a web server to a client, such as Microsoft's Classic ASP, Sun Microsystems' JavaServer Pages,[155] and mod_perl. PHP has also attracted the development of many software frameworks that provide building blocks and a design structure to promote rapid application development (RAD). Some of these include PRADO, CakePHP, Symfony, CodeIgniter, Laravel, Yii Framework, Phalcon and Zend Framework, offering features similar to other web frameworks.

text: The LAMP architecture has become popular in the web industry as a way of deploying web applications.[156] PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P may also refer to Python, Perl, or some mix of the three. Similar packages, WAMP and MAMP, are also available for Windows and macOS, with the first letter standing for the respective operating system. Although both PHP and Apache are provided as part of the macOS base install, users of these packages seek a simpler installation mechanism that can be more easily kept up to date.

text: As of April 2007[update], over 20 million Internet domains had web services hosted on servers with PHP installed and mod_php was recorded as the most popular Apache HTTP Server module.[157] As of May 2017[update], PHP was used as the server-side programming language on 83% of 10 million most popular websites.[158] Web content management systems written in PHP include MediaWiki,[159] Joomla,[160] eZ Publish, eZ Platform, SilverStripe,[161] WordPress,[162] Drupal,[163] and Moodle.[164] Websites written in PHP, in back-end and/or user-facing portion, include Facebook,[165] Digg,[166] Tumblr,[167] Dailymotion,[168] and Slack.[169]

text: For specific and more advanced usage scenarios, PHP offers a well defined and documented way for writing custom extensions in C or C++.[170][171][172][173][174][175][176] Besides extending the language itself in form of additional libraries, extensions are providing a way for improving execution speed where it is critical and there is room for improvements by using a true compiled language.[177][178] PHP also offers well defined ways for embedding itself into other software projects. That way PHP can be easily used as an internal scripting language for another project, also providing tight interfacing with the project's specific internal data structures.[179]

text: PHP received mixed reviews due to lacking support for multithreading at the core language level,[180] though using threads is made possible by the "pthreads" PECL extension.[181][182]

text: As of January 2013[update], PHP was used in more than 240 million websites (39% of those sampled) and was installed on 2.1 million web servers.[183]

text: Security[edit]

text: In 2013, 9% of all vulnerabilities listed by the National Vulnerability Database were linked to PHP;[184] historically, about 30% of all vulnerabilities listed since 1996 in this database are linked to PHP. Technical security flaws of the language itself or of its core libraries are not frequent (these numbered 22 in 2009, which was about 1% of the total, although PHP applies to about 20% of programs listed.)[185] Recognizing that programmers make mistakes, some languages include taint checking to automatically detect the lack of input validation which induces many issues. Such a feature is being developed for PHP,[186] but its inclusion into a release has been rejected several times in the past.[187][188]

text: There are advanced protection patches, such as Suhosin and Hardening-Patch, that are especially designed for web hosting environments,[189] primarily due to these environments being seen as places where carelessly written code may run.

text: There are certain language features and configuration parameters (primarily the default values for such runtime settings) that make PHP applications prone to security issues. Among these, magic_quotes_gpc and register_globals[190] configuration directives are the best known; the latter made any URL parameters become PHP variables, opening a path for serious security vulnerabilities by allowing an attacker to set the value of any uninitialized global variable and interfere with the execution of a PHP script. Support for "magic quotes" and "register globals" has been deprecated as of PHP 5.3.0, and removed as of PHP 5.4.0.[191]

text: Another example for the runtime settings vulnerability comes from failing to disable PHP execution (via engine configuration directive)[192] for the directory where uploaded images are stored; leaving the default settings can result in execution of malicious PHP code embedded within the uploaded images.[193][194][195] Also, leaving enabled the dynamic loading of PHP extensions (via enable_dl configuration directive)[196] in a shared web hosting environment can lead to security issues.[197][198]

text: Also, implied type conversions that result in incompatible values being treated as identical against the programmer's intent can lead to security issues. For example, the result of the comparison "0e1234" == "0" comparison is true because the first compared value is treated as scientific notation having the value (0×101234), i.e. zero. This feature resulted in authentication vulnerabilities in Simple Machines Forum,[199] Typo3[200] and phpBB[201] when MD5 password hashes were compared. Instead, either the function strcmp or the identity operator (===) should be used; "0e1234" === "0" results in false.[202]

text: In a 2013 analysis of over 170,000 website defacements, published by Zone-H, the most frequently (53%) used technique was exploitation of file inclusion vulnerability, mostly related to insecure usage of the PHP functions include, require, and allow_url_fopen.[203][204]

text: Criticism[edit]

text: Despite being a programming language that powers 80% of the web[205], PHP has faced a lots of criticism. PHP has been criticized the many reasons, the most common reasons have always been not being strictly type cast and lacking high scalability. Many languages have been predicted to replace PHP in past, but the user base of PHP is still considerably large as in 2017. Despite all the criticism, PHP has outlived the expectation of many[206] and is used by some of the most famous CMSs like Wordpress and frameworks like Laravel. The reason for this is considered regular developments that have been done in PHP that have matured PHP as a programming language to be very easy to design, develop, deploy.[citation needed]