Learn what's new in PHP 7
4.5 (335 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
15,273 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Learn what's new in PHP 7 to your Wishlist.

Add to Wishlist

Learn what's new in PHP 7

Review all the new features that are coming in PHP 7 and get your app's up to speed.
4.5 (335 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
15,273 students enrolled
Created by Lawrence Turton
Last updated 8/2016
English [Auto-generated]
Price: Free
  • 3.5 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • new features PHP 7
  • Deprecated features in PHP 7
View Curriculum
  • Understand the basics of PHP
  • Know about XAMPP or a similar service

PHP7 is the newest edition of the language to hit the server side in 2016. This well established and much loved language is providing significant performance improvements, providing new features and improving security. PHP has always been the goto language when it comes to server side database interactivity and data integrity with simplicity and ease of use.

The first and most prominent speed increase is the PHP7 engines speed which is nearly double the performance of the previous PHP 5.6 engine. This alone should be coveted by developers who don't even need to optimise their code but just to run it in the new engine and see massive performance increases. Wordpress, Joomla and other popular CMS's have been run out of the box with no code changes and huge performance increases have been seen with no optimisation needed at all.

But what about the other features and your script's, Will they work? Well to find out I'll be showing you additional features which may not be that dramatic after all. New features are always fun to learn but some new features will just be a simple parameter being passed into an already existing function. For example the unserialise function will now accept another optional parameter to only unserialise an object that came from a particular class; making it a little more secure. Also as we're on the topic of security and parameters the existing password hash function will no longer accept a salt but rather it will automatically generate a secure salt for you.

The new PHP version is a nice addition to the PHP family with refined features all round. PHP will still be around despite what developers say. It's still currently the best and most secure language for database interaction with PDO, scalar data validation, prepared statements, secure password hashing and salting. It really is still the king pin! Every language has it's place and PHP is firmly settled in on the server side and despite being a Javascript developer it's still is a very established language.

Who is the target audience?
  • Exisiting PHP developers who want to learn whats coming
  • Someone who's learnt the basics of PHP and wants to further their understanding
Compare to Other PHP Courses
Curriculum For This Course
26 Lectures
Getting setup
2 Lectures 06:14

Welcome to this course, I'll first introduce myself and why you should want to take this course. Also give you some knowledge about what you'll need to take this course.


Before we being lets take a look at XAMPP where we want to setup PHP7 which you must download the correct version to take this course.

XAMPP PHP7 setup
PHP 7 new features
16 Lectures 02:14:53

Scalar is a popular language that has some type declarations for arguments; now this is available in PHP. This will make your functions more structured and coerce the parameter data types to be what you want.

Primitive type declarations

This lecture will cover type coercion of object data passed to our functions arguments.

Object type declarations

PHP 7 supports data type declarations for values returned from a function. Similar to argument type declarations, return type declarations specify the type of the value that will be returned from a function.

Return type declarations

Some lovely sugar syntax for PHP developers. Instead of if statements and writing unnecessary code but rather in one line we can optionally define the value of variable.

Null coalescing operator

The spaceship operator is good for doing a comparison of two numbers and returns differing values depending on the comparison.

Spaceship operator

Array constants can now be defined with define(). In PHP 5.6, they could only be defined with const.

Constant arrays using define()

Support for anonymous classes has been added via new class. These can be used in place of full class definitions for throwaway or framework objects.

Anonymous classes

PHP7 now lets you use unicode characters escaped by UTF-8 in the hexadecimal format.

Unicode codepoint escape syntax

Your function's can be invoked with a predefined value for the this context; set by the call method. This is very similar to JavaScripts call method and works in the same way.

Functional call context

This feature seeks to provide better security when unserializing objects on untrusted data. It prevents possible code injections by enabling the developer to whitelist classes that can be unserialized.

Unserialize filtering

Expectations are a backwards compatible enhancement to the older assert() function. They allow for zero-cost assertions in production code, and provide the ability to throw custom exceptions when the assertion fails.

Classes, functions and constants being imported from the same namespace can now be grouped together in a single use statement.

Group use declarations

The new intdiv() function performs an integer division of its operands and returns it.

Integer division

The session start function now accepts an array of options that override the session configuration directives normally set in php ini file.

Session options

Two new functions have been added to generate cryptographically secure integers and strings in a cross platform way: random_bytes() and random_int().
Random bytes and random int functions

The new preg_replace_callback_array() function enables code to be written more cleanly when using thepreg_replace_callback() function. Prior to PHP 7, callbacks that needed to be executed per regular expression required the callback function to be polluted with lots of branching.

Revamped regular expression function
PHP Generators
5 Lectures 42:09

Generator functions are a new way of programming. They allow us to control the execution of a function and even change the state of the function in mid execution.

What are Generators?

We've discovered generator functions allow you to pause and give way to other processing providing flexibility in programming. Lets delve into the syntax of generators and see how PHP works with them.

Generator Syntax

Generators allow for yielding values so that you can evaluate and use that value outside of the generator function.

Generator Yielding Values

Next we want to take a look at all the different primitive types like string, integer, float or bool and objects such as a class object, array or associative array.

Generators Yielding Datatypes

Generators where introduced in PHP5.5 but in PHP7 and above there are new features we can work with. Such as return statements and yielding from other yield functions.

PHP7 Generator New Features
PHP 7 deprecated features
3 Lectures 16:08

[DEPRICTAED] Style constructors

PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated. PHP 7 will return an E_DEPRECATED please only use the __construct() method.

[DEPRICATED] Static calls to non-static methods

Static calls to methods that are not declared static are deprecated, and may be removed in the future.

[DEPRICATED] Password hash

The salt option for the password_hash() function has been deprecated to prevent developers from generating their own (usually insecure) salts. The function itself generates a cryptographically secure salt when no salt is provided by the developer - therefore custom salt generation should not be needed.

[DEPRICATED] Capture session meta data

The capture_session_meta SSL context option has been deprecated. SSL metadata is now available through thestream_get_meta_data() function.

PHP 7 Depricated features

Thank you for taking this course and I hope to see you using PHP 7 at its best in the future.


Get any course from myself at 50% off the standard value!

Bonus Lecture: A nice little coupon code
About the Instructor
Lawrence Turton
4.5 Average rating
9,790 Reviews
99,061 Students
7 Courses
Technical Instructor

Lawrence Turton works as a web developer & graphic designer specialising in HTML, CSS, jQuery, UI & UX design. He has previously worked with Fifteendesign producing websites, iPhone and Android apps and started his own agency in 2010 called Elite Web Design. During that time Lawrence has established a wide range of clients from blue chip companies to large corporations. From a young age he was an online instructor and started to work with two of the leading online training specialists Cartoonsmart and Envato. Lawrence always created projects involving designs in Photoshop and bringing his creations to life by coding them with web technologies. This gives him a unique perspective into real world projects from start to finish and a wealth of information for new comers to the web industry.