Join Kevin Skoglund for an in-depth discussion in this video About PHP 7, part of PHP 7 New Features.
- [Voiceover] Before we dive into learning about the specific key features of PHP 7, let's start by first getting an overview of it. PHP 7 is the first major release of PHP in 11 years. That's a long time to go between major versions and software development. And PHP 7 itself has been two years in development. It features an all new version of the Zend Engine, which is much faster, uses less memory, and has consistent 64-bit support. Now, if you've been using PHP up until now, you've probably been using PHP 5 and you're maybe wondering, well what happened to PHP version 6? PHP 5.0 was released in 2004, and shortly thereafter, PHP 6 development began and it had an ambitious goal.
They wanted to put native Unicode support throughout PHP. That effort involved modifying every little bit of PHP code to make sure that support for Unicode was supported and maintained. That meant that PHP could handle not only regular, single byte characters, like you have on your keyboard, but also multibyte characters, characters from other languages, such as Chinese, Greek or Arabic, as well as symbols. That turned out to be too big of an undertaking, and after working on it for five years, everyone felt very burnout and they decided to abandon Unicode support.
At the same time, there were many finished features that had been scheduled for PHP 6 that were not related to Unicode and those features were released in PHP 5.3 and 5.4. If you're working with PHP when those releases came out you may remember that they actually were pretty big releases they had some pretty big changes in them and that's why. In fact, some people in hindsight think that PHP 5.4 should have become PHP 6, but it didn't. It stayed PHP 5.4 and then the question became, what do we call the next version of PHP? The issue was that PHP 6's goals were public for five long years, and they'd been discussed in-depth at conferences, on blogs, which were still available online, and even in published books.
So a vote was taken, and it was to decided that to avoid confusion, version PHP 6 was going to be skipped and we would move right to PHP 7. And that would make it clear that PHP 7 did not have the Unicode support that PHP 6 had promised. So, at that point, we got PHP 7 which was finally released on December 3rd of 2015. Throughout the upcoming chapters, we're going to go through the many features and improvements that PHP 7 offers us. Overall, I think you'll find that it's a good release, and that it's worthwhile for you to upgrade.
- Scalar type and return type declarations
- New operators in PHP 7
- Anonymous classes
- Arrays as constants
- Catchable exceptions and errors
- Integer division with intdiv()
- Deprecations and deletions