PHP 8 Released! My Top 5 Killer New Features

preview_player
Показать описание
PHP 8 is officially released in 2020, 26 Nov. I had the chance to play around with the language and I've come up with my top 5 new features to look out for when you use PHP8.

PHP JIT with fractal calculations.

--------
Follow Me: ⬇️
Instagram - Yeah, I don't have one.
Рекомендации по теме
Комментарии
Автор

Great video.

PHP is here to stay - it get's the job done well, with great stability, performance and with less time and effort then with many other languages.

wk
Автор

Finally.. I m restarting my dev career and i was always a php fan.

afiasheikh
Автор

The nice thing about PHP is the whole shared-nothing request container architecture.

In each request you have a clean state with now left overs and some guarantee that you are not piling up memory leaks over requests. This allows easy scaling. Since recent additions like preloading to the engine the performance cost of recreating the world each time is also heavily reduced.

This greatly matches the HTTP model and makes PHP the true web language for the server side.

Fast prototyping. You can spit out a proof of concept in PHP faster than you can boilerplate Hello World in some other languages. I can’t upload a go file and have it just run. I have to compile it, upload it, and run it. PHP is plug and play. Upload a file and done.

ojsojs
Автор

Named arguments is a gamechanger for me. I have some functions which require lots of arguments and it's painful having to remember argument order and repeatedly provide many arguments with empty values. Time to start writing a new build with Terraform!

cf
Автор

Number one surprised me 🙂. Good vid. You have earned a sub.

GreyDeathVaccine
Автор

Trailing commas! WOOHOO! Going between Javascript and PHP it's number one in my book.

LostInAutism
Автор

Constructor property promotion (2) is my favorite, but the logo is nice too :)

ricardo.fontanelli
Автор

Would love to see JIT benchmarking vs web assembly.

skavihekkora
Автор

Are you using vista in your laptop OS??

YohanesCandrajaya
Автор

Although I like the feature of named args, my argument (see what I did there?) would be that if your function has 6 or more default parameters there's something wrong in the way that code is structured. Likely the function does too much, has too many side effects or just doesn't really need those arguments perhaps they could be abstracted in some way (perhaps some kinda config object).
I'm just really starting out in PHP though I love C, C++ and C# so PHP is my ideal language for the web + Laravel rocks (though I don't mind .NET and C# there's some things I don't like). Thanks for your video!

fredhair
Автор

I wish there was a video showing differences in programming with php 8 for example :


echo "results";
}

is no longer allowed and will result in fatal typewrite error, in php 8 it should be like this

if($query || mysqli_num_rows($query)>0){
echo "results";
}

aristonia
Автор

Haha the logo is pretty great, agreed about the branding and the docs imo aren't great. Laravel is much better for docs and you're absolutely right a big lumbering elephant doesn't make for a great mascot of a fast language! lol

fredhair
Автор

Why use switch instead of look up table?

japetsaberon
Автор

I used to be a PHP developer but switched to Java and now Python. PHP Is great only for web development. Python on the other hand is great for Web Development, AI, ML, Math, and other scientific applications. I don't hate PHP I'm just saying that overall Python is better. Peace.

moronboy
Автор

Why is the monitor in the background, showing a reversed desktop?

MightyKK
Автор

when they will fix ternary operator? the only language, where nested expression using ternary operator sucks! i love this feature in other languages, but avoiding in php.
references suck at php too, i came from c/c++ world, implementation of pointers and references there is fabulous, so convenient and predictable, while in php it's just asking for trouble.

aerahtv
Автор

And now things are even looking good for PHP 8.1 with fiber and enum potentially being added. Fiber avoids the what is the color of your function problem of aysnc js.

ojsojs
Автор

There are too many scaling problems to overcome that more modern languages and supported infrastructures have solved to make php a modern player. The only reason to be using php is running a monolithic CMS platform where advantages may outweigh the cloud deployment, efficiency issues infamous to those large, legacy platforms.

toddzmijewski
Автор

PHP is becoming more of a niche, server-side language, mostly for basic websites and services. But most new web-apps on the other hand have long ago moved into the client-side javascript world

pixchcn