PHP Version 5 – everything you need to know

PHP 5

PHP 5 was released on 1 July 2004. That is 4 years after introducing PHP 4 to the scene of the Internet. The aim is to bring a lot of new functionalities to the PHP language. The focus of the team was on what is not very well supported and what is missing in the previous versions. The focus of the new PHP 5 version is on 3 major areas: Object-Oriented programming, XML, and MySQL support.

Object-Oriented programming

This feature was present in PHP 4, but in PHP 5 it is introduced an entirely reworked object model. It now offers:

  • Interfaces
  • Destructors
  • Constructors
  • Protected, private, and public properties and methods
  • Class type hints
  • Abstract classes
  • Final properties and methods
  • Static properties and methods
  • Magical methods

Programmers in PHP 5 are able not just to pass objects by value but also by reference.

Reworked MySQL extension

The MySQL extension is completely reworked in PHP 5. It provides support for MySQLi, which is the new version of MySQL. It means MySQL improved. This new extension offers:

  • Bound input and output parameters
  • Prepared statements
  • SSL connections
  • MySQL can now apply PHP’s new OO model
  • Multi-query functions

Reworked XML extension

XML tools were great for the job in PHP 4. Except, they were not actually designed to operate together, and often patches were necessary to complete the required functionality. In PHP 5 is applied a reworked XML parser with tools capable of operating with one another. Furthermore:

  • They are included in a single XML library: libxml2.
  • XML extensions can operate together as a whole.
  • They provide efficient data processing. 
  • XML extensions can provide you with the exact XML tool for the task.
  • They comply fully with W3 specifications.

The SimpleXML extension is also introduced in PHP 5. It allows you to handle the data in XML documents easily. It treats it as an array and looping through it.

Release history of PHP 5

5.0 version. PHP 5 was released powered by Zend Engine II with a new object model.

5.1 version. For accessing databases was added PHP Data Objects (PDO) as a lightweight, consistent interface. Improvements in performance with the introduction of compiler variables in re-engineered PHP Engine. 

5.2 version. Native JSON support. The filter extension is enabled by default. 

5.3 version. New features are Namespace support, late static bindings, jump label. Also, the Windows support is improved. Further added features like, sqlite3, and mysqlnd replacing libmysql as an underlying library for the extensions that operate with MySQL.

5.4 version. New features are trait support and short array syntax support. In addition, some improvements are made to the current performance and features, plus decreased memory requirements.

5.5 version. Further support for generators and finally blocks for exceptions handling. OpCache (based on Zend Optimizer+) in a set in the official distribution.

5.6 version. Constant scalar expressions, possible large file uploads, new interactive “phpdbg” debugger as a SAPI module, and other more minor improvements.

Is PHP 5.6 still supported?

If we have to give a short answer, it is “No.” This is because PHP developers are no longer supporting PHP 5.6 or any other version of PHP 5. On 31 December 2018, officially ended the support of PHP 5.6. 

Furthermore:

  • There won’t be any more security updates.
  • There won’t be any more bug fixes.
  • In a production environment, you should not use PHP 5.6 or any version of PHP 5. 
  • For security reasons, you should no longer use PHP 5. There are many out-of-date libraries and functions.

Leave a Reply

Your email address will not be published. Required fields are marked *