PHP: The Language Buried Alive
RyanJanuary 19th, 201711 minute read
Ryan is Codal's Junior Technical Writer. On the marketing team, he contributes blogs and articles for trade publications, Codal's website and blog, and marketing materials. Outside of Codal, he is a basketball fanatic.
The PHP programming language is much like the Latin language in that both dialects are referred to as "dead". Nonetheless, both of these languages still have a purpose.
PHP has carved out a niche by becoming the most popular programming language for both server-side applications and as a HTML embedded language. Web development agencies can instantly improve their HTML code by using PHP.
When a user of a site requests information, the server-side language is what connects the web browser with the database of the given site.
For example, suppose that you're on Wikipedia, and you click a link. The server-side language is what finds the specific page that you requested from the Wikipedia database(s) and delivers it to your browser.
According to a survey published by W3Techs, PHP is by far and away the most popular language for server communication:
Notable sites that use PHP for server-side communication include Wordpress, Wikipedia, and Facebook.
Far from being dead, PHP is currently the most popular language for communicating with the servers of a website.
Brief History of PHP
The achilles heel of PHP is that it was never meant to become a publicly used programming language at all.
Danish computer scientist Rasmus Lerdorf began working on Common Gateway Interface programs in C language circa 1995 for use on his online resume. Lerdorf created the acronym PHP referring to Personal HomePage.
Zeev Suraski and Andy Gutmans created the Zend Engine for PHP in 1999 while they were students at the Israel Institute of Technology. The Zend Engine serves as an open-source interpreter for PHP.
Rasmus Lerdorf never intended for PHP to become a programming language. He used PHP almost exclusively within HTML code.
After the Zend Engine released with PHP3, the meaning of the PHP acronym became reworked as "Hypertext Preprocessor".
The name Hypertext Preprocessor should indicate the true purpose of PHP. Nonetheless, many computer scientists will still judge the language on its (poor) ability to make executable programs.
What makes the PHP language special is that it can be embedded in HTML. Although the Zend Engine may fool some developers into thinking that the PHP language is meant for making applications, the PHP language performs best not when it is used with HTML for server side communication.
PHP Language Specifics
A defining language trait of PHP is that it requires a relatively low amount of typing.
Another distinguishing feature of PHP is the echo command. The echo command is similar to the print function seen in other programming languages. A key difference is that because echo is not a function, the output does not need to be in parenthesis.
Echo can also act as a command line calculator. For example, echo 5*10 would output 50.
Variables declared in PHP are easy to find because they are all preceded by the $ symbol.
PHP is often seen embedded in HTML. The PHP segments are always sandwiched between <?php and ?>.
In this example, we see a segment of PHP embedded inside of a full sequence of HTML.
Because the Zend Engine doesn't require PHP to be embedded in HTML, Hello World can be achieved in just one line:
echo "Hello World";
Criticism of PHP
Criticism of PHP is easy to find. Many developers (especially Ruby on Rails app developers) scapegoat PHP and leap at the opportunity to declare the language "dead" in favor of Java or Ruby on Rails.
Most of the criticism stems from a misunderstanding of the Hypertext Preprocessor title. One Stack Overflow contributor describes PHP as a "collection of useless processing tools".
PHP is not a language designed for app development but rather serves as a link between the HTML code and the server. Describing PHP as a useless collection of "processing tools" indicates a misinterpretation of what Rasmus Lerdorf created the language for.
If PHP was such a poor language and nearing the end of its useful life, you would expect its use to decrease over time. Use of PHP has indeed declined, but ever so slightly: less than .5% over the past year.
(Source) In the above chart, we can see that PHP is still used by 81.7% of websites which report their use of languages.
Conclusion: PHP might be Misunderstood, But it is Not Dead
If you measure a stapler on how well it can boil water, the stapler is bound to disappoint. But that doesn't mean that the stapler is "dead". The stapler just wasn't designed to boil water.
Likewise, if you judge the PHP language on how well it can create an application or an executable file, you're not using the language the way it was meant to be used (From a web development agency standpoint).
Despite the clamours of PHP being dead, its use has only declined .3% in the past year: from 82% to 81.7% of websites which reported their use of coding languages.