 Hello, yes, so I'm Dan blows I've been coding PHP for about 10 years I think since about WordPress version 1.5 somewhere around there For anyone that's come along wondering what happened to PHP 6 We just skipped over it entirely the main feature that was supposed to be in PHP 6 was native Unicode support But unfortunately it proved to be so difficult that it was just abandoned Entirely and all of the features other features from PHP 6 were backported into PHP 5 and then work started on PHP 7 now the main feature of PHP 7 is something that most of us won't see at all day-to-day and that's because it's how PHP is actually executed Because PHP is an interpretive language It first has to go from the PHP that we write into machine code that the computer can execute and in PHP 5 it did this by scanning ahead and taking complete instructions and Then turning those into machine code straight away Now it's a little bit outside what I can talk about in 10 minutes But the internals team decided to go with a system called the abstract syntax tree as a step in the middle Which allowed for PHP to use a lot less memory and that meant it could be a lot quicker Now if you're wondering how much quicker I did an installation of WordPress just a fairly standard Installation I used a bunch of the most typical plug-in. So Yoast and contact forms that kind of thing And I just set two standard word development boxes up They're completely identical the hardware is the same the operating system Everything's the same about these two boxes. The only thing that's different one's using PHP 5.6 the others on PHP 7 And what I found was that on request per second I could get around 20 out of PHP 5.6 But around 45 requests per second on PHP 7 Similarly the response time on PHP 5.6 I could get about 1500 milliseconds So that's the time to first bite on PHP 7 that was coming out about 650 milliseconds So this is without caching or doing any of the usual stuff. This is just literally testing the WordPress PHP So nothing has changed on these two boxes. Just one is using PHP 5.6 the others using PHP 7 So you can serve more than twice the requests at more than twice the speed and Without single changing a single line of code pretty much in the average code base So that's the main takeaway from this talk if you care at all about performance on your site and let's face it Who doesn't this upgrade into PHP 7 is about the biggest thing that you can do today And as well as the performance improvements there are lots of other new features mainly about making your code less buggy and More expressive for me. The biggest improvement is in the type system in PHP 5 obviously you could check that something was an object or an array But you couldn't check for things like strings and integers and now in PHP 7 you can do this so you can check for scalar types like string integer floats and booleans They work exactly the same way as the type system in PHP 5 One big problem though for me is that PHP will still do its best to convert things between Types so if you pass an integer and it's expecting a string PHP will still try to do its best to say Okay, I'll just convert that over and frequently it helps and frequently it doesn't the biggest source of bugs in my code It's probably this so now in PHP 7 you've got this strict types tag Which allows you to say if I say an integer. I really mean an integer. I don't mean something that can be turned into an integer Unfortunately have to do it on a per file level you there's no global flag But if you put this is the very top thing in a file then everything in that file will say If I say integer, I mean integer and so you just have to do it on every single file Which has a bit annoying, but that's what I'm doing at the moment So return type hints just as you can say are on a parameter. What types of parameters you're expecting You can also do what types of parameters. You're returning so you can say I'm returning a string or an object of a particular type And this works with the strict types declaration. We were just talking about and the scalar types as well Cost free assertions are a really useful feature for me because they allow me to say I Can pass an expression to this that evaluates to true or false and if it evaluates to false it throws an exception What's really useful about this is I can check these in development and then turn them off in productions I can do lots of expensive checks and then in production. It doesn't have any impact on the runtime The error system obviously in PHP 5 if you get a fatal error, there's pretty much nothing you can do about it It just throws an error You return something to the user and it logs, but there's not much you can do With PHP 7 you now have this throwable interface So errors implement the throwable interface as do exceptions and you can catch that do some cleaning up and return a nice error So if you're trying to catch any exceptions or errors or anything you need to catch a throwable The null colos operator is just a way of saying if foo is set and has a value return foo Otherwise return this default and you can also chain them together You can output unicode which is obviously really useful This is something the uniform variable syntax I can't go through all the changes today because it's only 10 minutes, but this is a really important one The uniform variable syntax just makes everything more consistent It's related to the abstract syntax tree and it means that you can now return Callables on results of static methods and everything in ways that you couldn't do in PHP 5 A lot of these would return errors, but now you can basically string all sorts of code together So you can write spaghetti code like you've never done before However, there is one big implication with this and this is really important if you are upgrading especially if you're using any old Libraries or anything and that's if you've ever written a line of code like this In PHP 5 this would be executed by looking for Bob on bar and then finding that on foo In PHP 7 this goes the other way around it will look for bar on foo and then look for Bob on the results So that this is one of the easiest source of bugs in PHP 7 It's very easy enough to fix you just wrap the part you want to go first in curly brackets And it just works and there's a library called fan which will scan your PHP code Looking for places you might have these problems So this is my main advice take away today upgrade is PHP 7 is really easy and will probably just work I've done three code bases now one of them literally took about two hours We set aside a couple of weeks and two hours in it was all done Upgrading is really easy if you've got root access to your box And you're on the latest the bun to you can just do see to app get update to PHP 7 so I get install Otherwise you have to install the repos, but again, they're really easy Managed hosting. I spoke to most of the big providers and they've said it is coming soon Things to check. Yeah, WordPress core and most of the plugins just work I had a look through and I didn't get any problems if you use in memcache Some people use it that seems to have some big bugs with PHP 7. It's worth knowing The deprecations my sequel functions and e rich functions are now gone completely So just use the PHP 7 versions my sequel iron preg So just really quickly the PHP 7.1 you can now just as you can say this should return a particular type You can also say it should return nothing at all with the void return type nullable parameters are a way of saying You can pass null or an integer but without setting a default value Which is quite useful in some cases and you can also do the same with return values The null coalesce equals just allows you to set a value on foo if it doesn't already have a value or it's not already defined So it's a quick way of setting defaults these three all evaluate to the same thing List keys are really complicated to go through today But it's just a quick way of passing in an array and then using lists to write them to the Properties of a method of a class Union exception types if you're catching multiple exception types But then doing exactly the same thing with them in PHP 5 you had to do this by just copying and pasting the code into the different blocks With PHP 7 you can get around this by just catching multiple exception types using the union operator. That's there HTTP 2 server push. It's probably worth knowing about It's too detailed to go in here But if anyone's used the HTTP 2 system It's a way of sending the CSS and images and JavaScript over with the initial request rather than request Requesting them after and then sending them over so yes too much code and too difficult to go into in 10 minutes But I'll be around for the rest of the day if anyone has any questions come and ask me