bookmark_border​Why is there no PHP 6?

For computing experts and coders, this is not a mystery. However, for people getting their first approach to Hypertext Preprocessor (PHP), the jump between PHP 5 and PHP 7 can seem strange. Let’s see what exactly happened with this missing version. 

​Why is there no PHP 6?

There is not PHP-6 because it was never released. Its original plan didn’t work as expected. To avoid confusion and not relate new developments (versions) to an unsuccessful experience and negative opinions, the decision was to jump directly from PHP 5 to PHP 7.

​What was the original plan?

The functionality of the PHP scripting language made it really popular among coders. Therefore, the development of new and enhanced versions has kept going since its original release in 1994. Rasmus Lerdorf, its creator, and soon more enthusiast coders joined the effort to improve PHP.

In 2005, PHP 5 was in use, and planning for the next version’s development started. Enthusiasm was big, and plans were ambitious. PHP 6 would include native Unicode support in the API, engine, and extensions. Therefore, no external libraries would be needed, very few conversions required, and language bias would be avoided.

Besides:

  • The safe_mode, together with the “register_globals” function, would be deleted.
  • A new 64-bit integer type was considered.
  • A traits feature for horizontal reuse of the language.
  • Additional static typing features.
  • A goto keyword, avoiding the goto name but adding target labels to break.

What went wrong with PHP 6? 

Efforts to achieve these goals were hard. Especially the Unicode conversion took much longer than expected. And finishing this was key, the base for adding the rest of the new features. As a reference, in 2011 PHP 6 Unicode conversion task advanced around 70%.

To run a website without Unicode is hard, and your coders know it. Supporting Unicode is possible until a certain point, even in case the used language is not compatible with Unicode, but errors are easy to get. It’s not an easy task. 

Accurate support for Unicode demands a language that can understand Unicode strings. And as we mentioned before, PHP 6 ambitious plan was to support it completely (API, engine, and extensions).

To achieve the goal and make compatibility possible with the International Components for Unicode (ICU) library, using the two-byte UTF-16 encoding for all the strings inside PHP was decided. It sounded logical since ICU’s system used it, and interactions inside ICU were calculated to be more than with outside players like disk files or MySQL. 

Rephrasing, for coders, reading or writing a string from an outside source usually happens once. But many Unicode actions can be required on the same string. A conversion for every action multiplies the job. So to use the two-byte UTF-16 encoding looked like a proper solution, at least in theory.

Unfortunately, the decision was not as useful as expected in practice, and its cost went really high. Still, other conversions were needed to do, for instance, script code, request data, database results, etc., from UTF-8 to the UTF-16. And such conversion demanded more CPU processing. A UTF-8 string required half the memory that UTF-16 took. Besides, due to the conversion, sometimes manual checks were needed to identify the exact location of an error. It could be either in the original encoding or in the converted one.

What happened with PHP 6?

Unicode support became the PHP 6 Achilles heel. No matter the effort, opinions about it were negative. Its performance was qualified as poor, broken scripts were constant, and memory usage went high. 

In March 2010, the development of PHP 6 officially stopped. Its features not related to the Unicode were transferred to the new PHP 5.4. 

bookmark_borderPHP 7 explained

PHP 7 explained

PHP 7 is a significant release of PHP programming language. It is promoted as a revolution. As for how web applications are possible to be developed and produced for the cloud and mobile to enterprises. This particular release is pointed to be the most significant improvement for PHP after the announcement of PHP 5 in 2004. 

Initiation of the development of PHP 7

The initiative for the development of PHP 7 came from Dmitry Stogov, Xinchen Hui, and Nikita Popov. These three developers designed a test branch of PHP that they first named PHP Next Generation (PHPNG). The PHP community embraced it, as it had crucial performance improvements. It continued to develop into a well-built version now known as PHP 7. After some months of beta testing, the official release was in December 2015.

What Drove the Need for PHP 7?

The PHP language is extremely popular. Rasmus Lerdorf created it in 1994. Since then, it has gained popularity, and now approximately 82 percent of websites implement PHP. That indicates that most of the Web is relying on this language. In addition, the amount of people online is continuing to increase. This includes the rapidly growing number of mobile users. Therefore, the servers that power the world’s websites are necessary to be able to respond fast to user requests. Speed is an essential factor in the design of a website. People are going to leave a web page that takes a lot of time to load. 

The PHP changes boosted the performance of sites dramatically. It is estimated that version 7 gives a 100 percent increase in performance speed compared to version 5.6. This allows the developers to make websites that present attractive and interesting interactive traits that can also respond to visitors’ input fast. 

The development of this version was also motivated by the need for scripting languages that work more efficiently. The desire for that is inspired by two things: the need to decrease power consumption to protect the ecosystem and the need to reduce expenses.

It reduces the demands on the servers, which makes it more friendly for the environment and more cost-effective decision. In addition, compared to PHP 5.6, running PHP 7 applications needs less energy to power servers.

New Features

To PHP 7 are added a lot of new features. The most significant ones from them are the following: 

  • Improved performance − It is twice faster than PHP 5 when you have a PHPNG code united in PHP 7.
  • Scalar type declarations − Now, return types and parameters are able to be implemented.
  • Less Memory Usage − The optimized PHP 7 consumes a lot lesser resources.
  • Exception hierarchy − The feature is improved.
  • 64-bit support − 64-bit architecture machines receive constant support.
  • Several fatal errors converted to Exceptions − The variety of exceptions is extended. Including many fatal errors turned into exceptions.
  • Null coalescing operator (??) − A new feature is applied to replace the ternary operation in conjunction with the isset() function.
  • Secure random number generator − Increase of the latest secure random number generator API.
  • Return and Scalar Type Declarations − Added support for the return type and parameter type.
  • Deprecated SAPIs and extensions removed − Several past and unsupported SAPIs and extensions are eliminated from the PHP 7 version.
  • Anonymous Classes − It is added support for anonymous.
  • Zero cost asserts − Also added support for zero cost asserts.

PHP 7 applies new Zend Engine 3.0. The purpose is for the performance of the application to improve twice. Also, the consumption of memory to be 50% better than PHP 5.6. This allows without any extra hardware to work for more concurrent users.

PHP 7 is created contemplating today’s workloads.

bookmark_borderPHP 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.

bookmark_borderHistory of PHP programming language

PHP, or also called Hypertext Preprocessor, is the most popular server-side scripting language. It is incredibly adaptable and holds plenty of innovative features. 

Early History of PHP 

Rasmus Lerdorf developed PHP in 1994 but to maintain his personal homepage. Later on, in 1998, Andi Gutmans and Zeev Suraski, two talented programmers, met him to take PHP to another level. So, the goal was to be used to redesign web pages.

Lerdorf named it Personal Home Page because he meant to use it personally. But his creation started to gain recognition by other programmers, and eventually, it turned into a global web programming language. Thus its name became Hypertext Preprocessor.

For sure, the aim behind the development of this language was not to gain such popularity and global usage. The interest was so uncontrollable and unexpected that Rasmus Lerdorf was not able to protect and limit its individuality.

Still, his venture has proved to be helpful for the coming generation with discovering new ways of web development.

History of PHP versions

It is easy to notice the growth of web development through the regular supplement of newer PHP extensions.

With every one of them, they allow web programmers to create more attractive and dynamic web pages. As time progressed, a lot of changes to PHP versions were made. 

  • PHP 1 and 2: The first two original variants of PHP are not created with enough features. However, they have established the benchmark for future versions to get additional advancement.
  • PHP 3 and 4: These two variants experienced significant developments as Zeev Suraski, and Andi Gutmans recreated the whole language. As a result, the new name of the language became Hypertext Preprocessor. During this period was added also improved parsing system named Zend Engine. The functionality is expanded and more powerful with introducing global, command-line interface and object-oriented programming.
  • PHP 5: In 2004 came the fifth variant of PHP, which was powered by the new Zend Engine II. The great new added feature of the latest version was the possibility to manipulate the database easily and have continuity. Moreover, in this version was added a binding variable.
  • PHP 6: In this version was embedded the ICU (International Components for Unicode) library into the program. However, this variant was abandoned, and it wasn’t launched in the market due to some other reasons.
  • PHP 7: In this version of the PHP programming language can be found various features. They didn’t exist in the earlier variants. Some of them are 64-bit integer support, return and scalar type declarations, etc. Also, it is powered by Zend Engine 3.

The latest release

The major version update is PHP 8.0. It brings various new features to the type system, error handling, object-oriented programming, strings, and more.

The future of a programming language that powers a vital part of applications and Internet websites results from many people’s efforts.

Although, PHP is trying to be conservative and exclude changes that might break a larger part of the applications. Still, the new release comes with numerous significant new features. Some of them are JIT, Named Parameters, Constructor Properties, and Attributes. They bring a lot of improvements and changes in syntax. Also, there are several minor changes, such as a resource to object migrations, advanced error handling, and modifications in operators and engine comparisons. They help to reduce the chances of overlooked bugs.

bookmark_borderWhat is PHP, and why is it used?

PHP explained.

The short acronym PHP is for Hypertext Preprocessor. So, yes, the unusual is that it doesn’t follow the name. Simply, it is a server-side, open-source scripting language. Its primary use is for the development of web applications. It is a scripting language because it is a program that is based on a script, lines of code. The purpose of which they are written is to automate tasks.

It is an open-source language, which means you have full access to the source code of the language itself. So, in the case of PHP, you can visit the PHP website, and view how it was written.

The web pages are designed with HTML. When we are talking about HTML, the code implementation is performed on the user’s browser. That is the client-side. In the case of PHP server-side scripting language, the code is implemented on the server. That is before it goes to the web browser of the user.

It is possible to embed PHP in HTML. It suits very well for web development and building a dynamic web page for web applications, database applications, and e-commerce. In addition, it is rated as a friendly language. It has the ability to connect with Oracle, MySQL, and other databases easily.

What does Scripting Language mean?

A script is a collection of instructions for programming that are constructed at runtime. A scripting language is a language that construes scripts at runtime.

Usually, scripts are embedded in another software.

When scripts are used, the goal is to improve the performance or to make regular tasks for an application. 

As we mentioned, Hypertext Preprocessor is a server-side script, which is interpreted on the server. On the other hand, JavaScript, for example, is a client-side script interpreted by the client browser. Both JavaScript and PHP can be set into HTML pages.

Cases to use PHP. 

There are three main areas where Hypertext Preprocessor is usually used:

  • Command-line scripting – It is perfect for scripts made applying Task Scheduler or cron. Plus, it is excellent for simple text processing.
  • Server-side scripting – This is PHP’s principal field. If you are just starting and practicing at home, this is the perfect form to do it. 
  • Formulating desktop applications – If you have experience using PHP and would be interested in trying some of the advanced PHP features, you can additionally try PHP-GTK to develop such programs.

Why use PHP?

There are various programming languages out there. If you are still wondering why you should use PHP, here are some unbeatable reasons to do so.

  • It is free and open-source.
  • Extensive community document
  • Quick learning compared to another language such as ASP, JSP, etc.
  • Unlike other languages, most web hosting servers support PHP by default. For example, languages such as ASP need IIS. So, it is a more efficient choice.
  • Another advantage that you receive with it is that it’s a server-side scripting language. That indicates you only have to install it on the server. Also, customer computers asking for resources from the server are not required to have PHP installed. Just a web browser is going to be enough.
  • It is updated frequently. Thus, it keeps up-to-date with the latest technology tendencies.
  • It holds inbuilt assistance for operating with MySQL. That doesn’t mean you can’t apply PHP with other database management systems. You can yet apply it with the following:
    • Oracle
    • Postgres
    • MS SQL Server
    • ODBC
  • It is cross-platform. You can use your application on several OS, like Windows, macOS, Linux, etc.