Back Button Languages
PHP 8 Crash Course

PHP 8 Crash Course

It's hard to believe, but PHP 8 is right around the corner. As part of this new release, not only will you benefit from performance improvements - thanks to the new JIT compiler - but you'll also enjoy useful new operators and types, attributes, match expressions, and so much more.

If you're intrigued, hop in and we'll review everything you need to know.

Intermediate
8 episodes
31m
8
Latest Episode in This Series

Added 2 weeks ago

Weak Maps

Weak maps are effectively key value stores that allow for garbage collection. You won't reach for these...

Watch
PHP 8 Crash Course

PHP 8 Crash Course

Version: PHP 8

It's hard to believe, but PHP 8 is right around the corner. As part of this new release, not only will you benefit from performance improvements - thanks to the new JIT compiler - but you'll also enjoy useful new operators and types, attributes, match expressions, and so much more.

If you're intrigued, hop in and we'll review everything you need to know.

Begin
8
Latest Episode in This Series

Added 2 weeks ago

Weak Maps

Weak maps are effectively key value stores that allow for garbage collection. You won't reach for these...
Watch

Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.
    1. Free Episode Run Time 1:51

      Before we can play around, of course we must first download PHP 8. At the time of this writing, PHP 8 is not yet officially out. As such, we'll tap a custom Homebrew formula to make the installation process as painless as possible. Alternatively, you might consider using Docker or Vagrant to create an isolated environment for testing PHP 8.

    2. Free Episode Run Time 3:12

      First up on the agenda is the new Nullsafe operator. This operator - represented as a question mark - allows you to call a method on the result of any expression if it does not evaluate to null. It sounds confusing, but it really isn't. Let's have a look.

    3. Free Episode Run Time 2:06

      Switch statements in PHP are useful, yet clunky. Think of the new match expression in PHP 8 as an improved switch. It's far more terse and flexible than its counterpart.

    4. Free Episode Run Time 4:40

      Next up is constructor property promotion, which allows you to remove much of the tedious class initialization boilerplate code that you likely write for every any that accepts a dependency.

    5. Free Episode Run Time 1:25

      This next one is a small, but useful addition to PHP 8 that received unanimous support during the voting stage. You now have the ability to use ::class directly on an object. The result will be functionally identical to the result of get_class(). In PHP 7 and below, this functionality was limited to the class, itself.

    6. Free Episode Run Time 5:48

      Next up, we have named parameters. This new PHP 8 feature allows you to pass function arguments according to, not their order, but the parameter name, itself. Let's discuss the pros and cons of adopting named parameters/arguments in your own projects.

    7. Free Episode Run Time 4:51

      It took a global pandemic for PHP to finally add a str_contains helper function, but it's finally here (along with a few others). In this episode, we'll review str_contains(), str_starts_with(), and str_ends_with().

    8. Free Episode Run Time 7:32

      Weak maps are effectively key value stores that allow for garbage collection. You won't reach for these often, but they're nonetheless an important tool to have in your belt.

Series still in development robot

*Series still in development. Check back often for updates.