General Comparison
General Comparison
General Comparison
General comparison
The following table compares general and technical information for a selection of commonly
used programming languages. See the individual languages' articles for further information.
This article is about the scripting language. For other uses, see PHP (disambiguation).
imperative, object-oriented,
Paradigm
Procedural, reflective
Influenced PHP4Delphi
Implementation
C
language
OS Cross-platform
Website php.net
A web page or webpage is a document or information resource that is suitable for the World
Wide Web and can be accessed through a web browser and displayed on a monitor or mobile
device. This information is usually in HTML or XHTML format, and may provide navigation to
other web pages via hypertext links. Web pages frequently subsume other resources such as style
sheets, scripts and images into their final presentation.
A dynamic web page is a kind of web page that has been prepared with fresh information
(content and/or layout), for each individual viewing. It is not static because it changes with the
time (ex. a news content), the user (ex. preferences in a login session), the user interaction (ex.
web page game), the context (parametric customization), or any combination of the foregoing.
Scripting vs.
Programming Languages
PHP is very flexible: Simple PHP functions can be embedded within web pages, or it can work
the other way: HTML code can be embedded within PHP. We'll cover that in more detail in a bit.
PHP is very versatile: it can talk to a variety of external applications using a wide variety of
protocols, and it can parse (understand) a wide range of data interchange formats.
For example, it can talk to database programs like MySQL and Oracle, as well as smaller-scale
database programs like MS Access and Filemaker. That makes it very useful for developing
database-driven web applications. It can also talk to things like LDAP servers (for user
information) and, in the library world, Z39.50 servers, and numerous other things. Unfortunately,
we won't have time to cover interacting with databases in this class.
PHP has modules that can parse XML, various forms of delimited content, and of course, our old
friend MARC.
PHP is now a recursive acronym, that stands for "PHP Hypertext Preprocessor" ... but it didn't
always.
PHP originally stood for Personal Home Page Tools. It began in 1994 as a set of programs
written by programmer Rasmus Lerdorf, that he used to perform tasks related to the maintenance
of his personal home page, such as displaying his résumé. Lerdorf released PHP publicly on June
8, 1995 to accelerate bug location and improve the code.This release was named PHP version 2
and already had the basic functionality that PHP has today. This included variables, form
handling, and the ability to embed HTML.
Versions
PHP 3.0 was the first version that closely resembles PHP as we know it today. It was created by
Andi Gutmans and Zeev Suraski in 1997 as a complete rewrite, after they found PHP 2.0
severely underpowered for developing an eCommerce application they were working on. In an
effort to cooperate and start building upon PHP existing user-base, Andi, Rasmus and Zeev
decided to cooperate and announce PHP 3.0 as the official successor. This is also when the
acronym took on its current meaning.
One of the biggest strengths of PHP 3.0 was its strong extensibility features. PHP 3.0's
extensibility features attracted dozens of developers to join in and submit new extension
modules. Arguably, this was the key to PHP 3.0's tremendous success. (And it's why PHP can
talk Z39.50 and MARC, which are of interest to only a vanishingly small percentage of its user
base).
PHP 4.0 was officially released in May 2000, following a rewrite of its core engine (the Zend
engine), which dramatically improved its performance. A huge upswell of PHP adoption
followed this release, and today you'll still find many useful applications written in PHP 4, even
though it's been 4 years since PHP5 went into general release.
PHP 5 was released in July 2004 after long development. It contained numerous new features
and a few big changes, but we won't bother to enumerate them here because they wouldn't be
relevant to an introductory class. The most important fact to note about PHP5 at this stage is that
it is mostly, but not completely, backwards-compatible with version 4.
For the past 4 years, PHP4 has continued to be supported by the PHP development team.
However, the last official patch for PHP4 was released in August 2008, so we can anticipate that
its availability will be increasingly limited from here on in (that is, limited to servers whose
admins don't care that much about security). This would be important to consider if, for example,
you were considering deploying an application that had not been tested under version 5. And
your development environment should be PHP5, although at this stage of the game it doesn't
matter much.
PHP6 is in development, but no date has yet been set for its release.
Why PHP?
It's true ... PHP is not the only game in town. Truth be told, there are a plethora of tools that do
similar things. In the Microsoft realm, there's ASP (and more recently, ASP.net). In the Java
realm, there's JSP. And there are even a lot of open source alternatives, including stalwarts like
Perl, and upstarts like Ruby (and its highly successful framework, Ruby on Rails).
So why focus on PHP, rather than one of those other options? PHP combines a number of
advantages that are pretty hard to beat: it's free (unlike ASP), it's relatively easy to learn (unlike
JSP), it's built for the web from the ground up (unlike Perl), and it's darn near ubiquitous (unlike
Ruby). Also, your instructors have done a fair amount of work in PHP, and not so much with
some of the alternatives, except maybe Perl.
Documentation
The main source of documentation for PHP is http://php.net. This site contains a wealth of
information, including a tutorial, faq, software downloads, and the main reference work, the PHP
Manual, which is where you'll be spending most of your time if you take up PHP development
seriously.
If you're looking for a good introductory text, there are plenty to choose from. You might try
Learning PHP5, by David Sklar. PHP Programming for the World Wide Web: Visual
QuickStart Guide (2nd Edition) by Larry Ullman is another practical book on introductory to
intermediate PHP programming that's worth a look.
Most of the foregoing introductory material has been freely cribbed from the official PHP site,
and the PHP Wikipedia entry.