JSP and Beyond

a pragmatic primer on building web-based solutions with Java technologies

Hypertext Preprocessor (PHP)

The origins of Hypertext Preprocessor lie in Perl Scripts and CGI binaries developed in 1994. It was not until the 3rd release in 1998 that PHP resembles what it does today (it is currently in its 5th version at time this was written).

PHP is known for allowing people to easily and quickly create dynamic web-based content on a range of platforms such as Windows, Linux, Solaris, and various other Unix systems. PHP is open source and has very broad community support.

PHP Hello World
// Hello World in PHP
echo ‘Hello World!’;

Drawbacks of PHP
PHP has continued to improve and remains a popular language for developing dynamic web content, but historically has some drawbacks.

Not Designed as Object Oriented – PHP has not been designed with object oriented programming in mind. It was not until version 4 that an object model was introduced to the language.

Lack of Exception Handling – PHP does not have a native structure to handle exceptions. PHP 5 has introduced error handling.

Separation of Presentation and Logic – PHP lacks the ability to separate presentation and logic. This means that complex projects can become difficult to design and maintain.

Interpreted at Run Time – PHP code is interpreted line by line with each request. This means that it is less efficient than compiled code. There is, however, a tool from a commercial organization named Zend that will precompile PHP code.