PHP Match Expression - Match vs Switch - Full PHP 8 Tutorial

preview_player
Показать описание
In this PHP tutorial, you will learn about the newly added feature the match expression which was introduced in PHP 8. Match expression makes a block for switch statements much shorter & easier to read. You'll learn about the main differences between the match expression & switch statements with a real example. Do you like the match expression? Let me know your thoughts in the comments.

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments on videos, any feedback is greatly appreciated
THANK YOU!

LESSON 1.18

RESOURCES
Рекомендации по теме
Комментарии
Автор

MAN idk why u made this course for free, i've never seen someone that deeply experinced in a language and does as he said about giving the smallest details about any section of the topic
you deserve the BEST !
all I can say is thank you so much & this is my favorite course I ever countered

cse
Автор

This is a GOD-TIER course out there and this is free! Bless you man!

devdude
Автор

You killed it with this lesson. So many examples. It would take a couple of books to go through to collect this amount of information on a single topic.

benderbg
Автор

WOW! I love the new match(){}. It's refreshing & simpler. I feel like I am ahead of others because not many people know about match(). Tnx :D

snakemanluffy
Автор

Learning a lot from your PHP Tutorial Series. May god bless you with more knowledge to share with people. Thank you from INDIA :)

ujjwalsinghchauhan
Автор

Perfectly explained and right to the point. This is how code videos should be made!

btacd
Автор

Thank you so much to give this course for free. Your explanation is realy amazing . Pray for you.

shakilkhan
Автор

learning a lot from Gio. thoroughly explained basic fundamentals which I am looking for. thanks Gio

nyinyiandnyinyi
Автор

Explained with simple example but that understands lot more concepts.❤️👍🏻

aneeshacharya
Автор

It reminds me a lot of Pattern Matching in Scala (using keyword match), thank you very much for this series, I'm learning a lot from your videos and it's very structured your content :D

emanuelarturorivasescobar
Автор

*Doing my part of helping the YouTube algorithm to recommend this video.

You Sir did a great job explaining the full functionality of `match`.

SimpleLangSolution
Автор

The match statement really helps out sometimes. Thanks for this video.

zhozfem
Автор

Thanks, I haven't tried match before. surely use this.

HeyMehedi_
Автор

New subscriber here. You are amazing at this, Gio. Thank you!

aliermagok
Автор

It really a useful lesson. Thank you man .

aljehammuaadh
Автор

For me, it depends. But I love match() expression more than the switch statement. Great video as usual!

alnahian
Автор

thank you so much for this quality content. 🍀❤

shavindasilva
Автор

I think it's also good to note that if you decide to use an anon function as the value to some key in the match expression, if you want to pass some top level variable down into the anon functions, you can use the "use" keyword, like:

$type="bruh";
$values = [1, 2, 3, 4, 5];

$action = match(strtolower($type)){
"bruh" => function() use($values): string {
return implode(", ", $values);
}
};

echo call_user_func($action);

keemkorn
Автор

great explanation about match expression!

abdussukkur
Автор

I am learning so much from you. Thank you!

johna