When you hear the term PHP, do you think programming language? Or website builder? It’s become both. However, what you see today has changed significantly from its initial purpose. After all back in 1994, Rasmus Lerdorf only conceived of a set of ‘Personal Home Page Tools’ that would monitor his online resume.
The Accidental Computer Language
In a 2003 interview Rasmus says, I really don't like programming. I built this tool to program less so that I could just reuse code. Ten years later, PHP is now running on the web servers of one third of all domains on the World Wide Web.” In the next 14 years, that would jump to at least 95%.
Yes, what began as a simple set of Common Gateway Interface (CGI) binaries written in the C programming language, became something far more valuable over time—a framework upon which dynamic web applications could be built. It also gradually became a language. But not initially. How did this set of CGI binaries become the programming language of the world wide web?
We can thank Rasmus for introducing his PHP idea to the general public license (GPL) movement in June 1995. This meant developers could use the source code in ways Rasmus hadn’t envisioned. They could also work together to fix bugs in the code and improve it.
Between June and September of 1995, the future of PHP remained uncertain. Using a syntax similar to Perl and HTML syntax resulted in an inconsistent set of rules. However by October Rasmus’ complete rewrite of the code made it easy to adopt for developers who already knew C, Perl and similar languages. PHP was on the path to becoming a programming language. Yet, this organic transformation from CGI to its own language wasn’t something Rasmus expected.
"I don’t [sic] 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."
Makeovers of the code were frequent over the next several years. Some steps required rethinking in order to expand functionality.
For example, the June 1996 iteration was officially named PHP/FI 2.0. However, two university students found PHP/FI 2.0 didn’t power an eCommerce application like they wanted it to. So they overhauled the underlying parser and also overhauled the meaning of PHP. Goodbye, personal, home or page. Gone the idea this independent programming language was only appropriate for small projects. PHP stood for PHP: Hypertext Preprocessor.
Web developers adopted PHP rapidly! While in May 1998 only 60 thousand (1%) out of six million domains used PHP 3.0, by November 10% of the world’s web servers delivered domains using PHP 3.0. However, most of these domains’ web servers were hosted on Unix servers. Even though PHP 3.0 could be hosted on Window’s and Mac servers, the initial POSIX-compliant operating system requirement from PHP/FI 2.0 took some time to overcome.
Another obstacle delayed adoption on a broader scale. While PHP 3.0 could handle third party databases and APIs, it did this inefficiently. Recognizing this deficiency, Andi Gutmans and Zeev Suraski began work on PHP 4.0 months before they officially released PHP 3.0 in June 1998.
When they released PHP 4.0 officially in May 2000, they merged their first names to call their PHP core the ‘Zend Engine.’ This release handled complex applications proficiently. It also handled data input with a higher level of security. This highly functional version went through multiple updates. Even after PHP 5 was released in July 2004, development and security updates continued until August 2008.
The PHP 5.0 release in 2008 included an overhauled Zend Engine (2) and “improved support for object-oriented programing, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.” PHP interpreters for 32-bit and 64-bit operating systems rolled out over the next several years.
Bucking Unicode Integration
Responding to criticism that PHP had developed as a language which didn’t support Unicode natively, Andrei Zmievski set out to embed the ICU library and UTF-16 as an internal component. Unfortunately, there weren’t enough developers interested in the project, so eventually efforts to produce a 6.0 version of PHP language ended up as retrofits into PHP 5 releases. By March 2010, all efforts to release a 6.0 version were finally abandoned.
The current version, PHP 7.0, has abandoned the idea of integrating Unicode. Instead it’s focused on achieving compaction of data and improving cache access. The Zend Engine 3 delivers nearly 100% increases in performance—something Google pays attention to.
Disconnect Between Versions
Each PHP version demands compatibility within its version. So upgrades within a version seek to maintain 100% compatibility with earlier upgrades. However, whenever the community envisions a release with significant differences in the core or language syntax, backwards compatibility is options. This is one of the reasons there’s such a long support time after a new version is released.
For example, WordPress sites written using PHP 4 can ‘break’ during a PHP upgrade to 5.0, or an upgrade from 5.0 to 7.0. Differences in the syntax between versions may render a site undeliverable.
Fortunately, support for PHP 5.6 extends to December 2018, so additional updates should roll out over 2017 and through the early part of 2018. After this, all websites built using the PHP 5 language become increasingly vulnerable to security breaches.
In 2017, 95% of websites use PHP 5, while 3.6% have adopted PHP 7.0. It’s an amazing success story. Can you believe it almost didn’t happen?
PHP is a powerful code base and can help improve business processes by creating applications such as inventory control and more. If this sounds like something your business could benefit from, contact us to speak to a member of our development team.