PHP is an Open source scripting language that is widely used to create Dynamic websites having database connectivity. The name PHP is short form of “Hypertext Preprocessor”. The PHP was initially created by Rasmus Lerdorf in 1994. He authored the first two versions of PHP. He collaborated with the PHP community that was led by Andi Gutmans and Zeev Surakski (both are founders of Zend technologies to produce later versions). The latest version of PHP is version 5.5.15 launched on 24 July 2014.
The Beta version of PHP 5.6.0RC3 will be released on 31 july 2014.
PHP is now become the most widely used scripting language for web, internet, e-commerce and B2B projects It is cross-platform language and can be used everywhere. It can run on all most all Operating systems (Linux, windows, Solaris, HPUX and UNIX). PHP is write once and deploy anywhere and everywhere type of language, and it supports almost all web servers like Apache, Microsoft IIS etc.
PHP scripts can be executed from command line and develops client side GUI applications that can operate on any platform.
What is scripting language?
Scripting means a series of commands that are interpreted and executed sequentially and immediately when any event occurs. Event is basically an action generated by user while interacting with a web page.
There are two types of scripting languages:
- Client side scripting
This type of script is executed on client side by browser.
- Server side scripting
This type of script is executed on server side. PHP comes under this category. Server side script interacts with database, fetch the required information specific to the user and display it to the user.
Server side scripting is invisible to the user. In server side scripting, the following two types of two way communication is done:
- Server to client
Web pages can be assembled from back end server output.
- Client to server
Customer entered information can be acted upon. In this type of scripting two main parts are used:
The scripting language
The scripting engine
The following are some of the tasks that can be implemented using server side scripting language.
- Content sites
- Forums, bulletin boards
- Customer support and technical support systems
- Business applications
- Surveys and polls
- Submission of forms online
- Catalog, brochure and informational sites
Features of PHP5:
- Improved object oriented capabilities
In PHP 5 explicit constructors and destructors are available. Object cloning, class abstraction, variable scoping, interfaces and improvement in object management.
- PHP strict standard
- We can declare FINAL classes and methods in PHP5
FINAL method means that they cannot be overridden by a derived class.
FINAL class cannot be extended.
- Objects in PHP5 can have 3 magic methods
- Try/Catch Exception handling
In try catch exception handling finally keyword is added. It allows developers to specify code to be run at the end of try and catch blocks, whether the exception was thrown or not.
- Improved XML and web services support
- SOAP extension available
SOAP stands for Simple Object Access Protocol. This is light weight XML based protocol for exchanging structure information between distributed applications over native web protocols such as HTTP, SOAP specifies the formats that XML messages use.
- Native support for SQLite
PHP 5 supports SQLite database server, which offers an easy solution for developers in case there is need to access heavy database products, without administrative privileges overhead.
Generators provide a way to handle iteration without having to write a class that implements the Iterator interface.
- Password Hashing
Password hashing API is the most important feature of PHP5. By using password_hash() and password_verify() functions, developers can easily handle password hashing in their sites.
- Array and String Literal Dereferencing
Array and string literals can now be de-referenced using array access syntax.
- Use of empty() with function ca.lls and expressions
The empty() construct can now be used with function calls and other expressions. That makes possible to use empty() on the return value of functions without capturing the value in a variable first.
- Class name resolution
Concept of namespaces in PHP is introduced. Now classes can be organized easily without any naming conflictions
- Changes in foreach loop
The list() construct in PHP allows the values of an array to be easily assigned to variables.