PHP is a computer programming language originally designed for producing dynamic web pages. The name PHP means PHP Hypertext Preprocessor.
PHP 5 was released 4 years after the introduction of PHP 4 to the Internet scene, aimed to bring a brand new functionality to the PHP language. The PHP team focused on what was missing or not well supported in the older versions. The 5th revision is focused on 3 major areas: Object-Oriented programming, XML and MySQL support.
While this feature was present in PHP 4, PHP 5 presents a completely reworked object model, which now offers:
In PHP 5 programmers can also pass objects by reference and not just by value.
PHP 5 comes with a completely reworked MySQL extension to provide support for the newest version of MySQL, now labeled MySQLi, which stands for MySQL improved. The new extension offers:
In PHP4, XML tools did the job, but were not really designed to work together and often patches were required to achieve the needed functionality. PHP5 brings a reworked XML parser, with tools, able to work with one another. The new XML extensions:
PHP5 also introduces the SimpleXML extension, which allows you to easily handle the data in XML documents, treating it as an array and looping through it.
Exceptions are very popular in other Object-Oriented languages, such as Python and Java, and were completely missing in PHP 4. With PHP 5, exception handling is now present in the PHP core, allowing for a separation of the programming logic and the error handling. The coder can now place them in adjoining blocs for easier referencing.
PHP 5 is the first version to have iterators in the PHP core. Iterators allow the coder to use a for-each loop through various data, such as XML files and database results. In the Standard PHP Library the coders can find a collection of iterators, through which the results of the loop can be filtered or modified.
All web hosting plans offered by NTC Hosting support PHP5. Our Web Hosting Control Panel comes equipped with a convenient tool, which will allow you to choose between PHP4 and PHP5 and will provide you with all the tools needed to create your unique website. We have also prepared a detailed comparison between the available PHP versions to help you choose the right one.