PHP

programming language
verifiedCite
While every effort has been made to follow citation style rules, there may be some discrepancies. Please refer to the appropriate style manual or other sources if you have any questions.
Select Citation Style
Share
Share to social media
URL
https://www.britannica.com/technology/PHP
Feedback
Corrections? Updates? Omissions? Let us know if you have suggestions to improve this article (requires login).
Thank you for your feedback

Our editors will review what you’ve submitted and determine whether to revise the article.

External Websites
Also known as: Hypertext Preprocessor
In full:
PHP: Hypertext Preprocessor

PHP, general-purpose programming language commonly used for web development. The language was created in 1994 and has remained popular since then because of its relative ease of use and open-source code. PHP was used in 2024 by more than three-fourths of all websites on the Internet for which the back-end programming language could be determined.

PHP is usually employed as a server-side language (as opposed to a client-side language, such as Java or JavaScript), meaning that code written in PHP is processed on servers rather than in Web browsers. The language is used to request content from a website’s server or database and to send the content to a user’s browser in a user’s requested data type, either HTML content, binary image data, or another form. For example, a user accessing a blog might trigger a PHP script to automatically retrieve the blog’s most recent posts, which are then displayed in the user’s browser.

PHP vs. HTML vs. JavaScript

While HTML provides the visuals of Web content, PHP is a dynamic language that enables users to interact with content. This is similar to JavaScript, but PHP is a server-side language, so content is not stored on the browser itself. Instead, the browser sends a request to a server to fulfill certain requests. This involves fewer manual updates from the website’s host.

Development of what would eventually become PHP began in the early 1990s, when Danish Canadian programmer Rasmus Lerdorf used the C programming language to build a simple set of programs to track visits to his online résumé. He named the scripts “Personal Home Page Tools,” which was quickly shortened to “PHP Tools.” Subsequent rewrites of the suite led to additional features, such as support for Web forms and communication with databases. On June 8, 1995, Lerdorf released PHP Tools’ source code, which allowed other programmers to customize and improve upon his work.

Meanwhile, Lerdorf continued to work on the project and updated the suite in September 1995 (at which time he briefly renamed it FI, short for “Forms Interpreter”). He gave the code a complete makeover in October (subsequently renaming it the “Personal Home Page Construction Kit”). In April 1996 Lerdorf introduced a fourth version of his tools, which he dubbed “PHP/FI.” Featuring an advanced scripting interface, built-in support for multiple databases (DBM, MySQL, etc.), and more, this iteration of Lerdorf’s work led to its gradual transformation into a new programming language. A 2.0 version came out in June 1996.

In 1997 two Israeli university students, Andi Gutmans and Zeev Suraski, undertook a complete rewriting of PHP/FI’s underlying parser, the component that “translates” the code for it to be executed and understood by other programs. The pair soon contacted Lerdorf to discuss their work, ultimately leading all three to collaborate on yet another implementation of PHP/FI, this time as an independent programming language. The trio emphasized the new language’s continuity of purpose with Lerdorf’s previous efforts by naming it “PHP 3.0,” although they altered “PHP” to stand for “PHP: Hypertext Preprocessor.” Other developers soon joined the project and in 1998 created the PHP Group—an organization to which Lerdorf transferred all rights to the language and which set official standards for PHP from then on.

PHP 3.0. officially launched on June 6, 1998. Powerful, consistent, and possessing a modularized architecture that allowed developers to easily add their own extensions, the language, which was already being used on 70,000 web domains, swiftly gained popularity. Before the end of the year, however, Gutmans and Suraski were already working on a makeover of PHP 3.0’s engine, aiming to improve performance of the complex applications that PHP helped to power. The resulting Zend Engine (so named by combining the developers’ first names, Andi and Zeev) formed the core of PHP 4.0, which launched on May 22, 2000. Web developers largely approved of the new version’s increased efficiency and added features. By the end of 2003 PHP was running on the Web servers of one-third of all domains on the World Wide Web.

PHP 5.0, powered by Zend Engine 2, launched on July 13, 2004. Along with the expected performance enhancements, the update offered a new object model (objects are various components of code such as variables), new extensions, improved error handling, and Extensible Markup Language (XML) support. However, the new version still lacked true support for Unicode characters, which are universal standard characters traditionally available across multiple platforms. In 2005 the PHP development team began work on PHP 6 with the intention of providing native support for multibyte characters (which are necessary to properly store Unicode), but this undertaking proved to be difficult for the group. Years passed without significant progress on the problem. Meanwhile, other major improvements earmarked for PHP 6 were finished on schedule and released as updates to PHP 5.

Get Unlimited Access
Try Britannica Premium for free and discover more.

In 2010 the PHP Group abandoned the project of a Unicode-aware PHP entirely. Since the aborted version had already been referred to as “PHP 6” in the media for years, it was suggested that the team’s next attempt be designated “PHP 7” in order to minimize any confusion. PHP 7.0 thus became the direct follow-up to PHP 5. Released on December 3, 2015, PHP 7.0 was powered by a third iteration of the Zend Engine and was twice as fast as the previous release. PHP 7.0 also used significantly less memory than prior versions of the program. New language features included null coalescing operators (a logical operator in languages such as C#), return type declarations, and the spaceship operator (an operator that compares three items).

PHP 8.0, released on November 26, 2020, had multiple new functions and optimizations. One of the most touted features was its just-in-time (JIT) compiler, which allowed code to be compiled while the program was being executed rather than beforehand. While offering little improvement for PHP’s web applications, the increased speed of numerical calculations opened new doors for the language’s use in other areas of computing, such as machine learning.

In 2021 key PHP contributor Nikita Popov declared his intention to shift his focus away from the language. Popov’s decision brought into clear focus the problem of PHP’s “thin bench”—despite PHP’s importance, only a few developers were so committed to the language’s development that they fully understood it. The PHP community responded to this pressing issue by forming the PHP Foundation, a nonprofit group seeking to ensure the future of PHP by hiring programmers to maintain and advance the language. An initial team of six sponsored developers began working for the organization in 2022.

Adam Volle