Variable, Anonymous, Callable, Closure & Arrow Functions In PHP - Full PHP 8 Tutorial

preview_player
Показать описание
In this PHP tutorial, you will learn the differences between variable functions, anonymous functions, callbacks & closures, and arrow functions. You will also learn another type in PHP called callable type.

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

LESSON 1.24

CHAPTERS
00:00 - Intro
00:20 - Variable functions
01:49 - Anonymous functions
02:38 - Closures & accessing variables from the parent scope
03:53 - Callable data type & callback functions
05:41 - Closure vs callable
06:05 - Arrow functions
Рекомендации по теме
Комментарии
Автор

I really like this course, basically it takes every single topic and delves into the PHP documentation to cover the important topics and gives examples. Moreover, the rythm is quite fast, which means that you don't lose focus and, the videos are short and to the point, which means that for somene who is learning this while working and looking after a family, you can go and see (or review) a 5 minutes a 10 minutes video. Perfect and I can imagine this has been a lot of work

gabryos
Автор

i think a separate detail video about callbacks and closure would be great Gio

prajwalsiwakoti
Автор

forget about functions but i wasn't aware of lot terms i have heard in this course from last 6 days . Great Tutorial

ZeeshanMRaje
Автор

So far i'm learning php in your videos and I'm loving it, thanks for this great free opportunity, i checked several php course on udemy, i bought one course and i didn't like it, until i found your youtube channel, as far as i can say, you teach very well!!!

FatosDaNaturezaOficial
Автор

Gio, I'm so sorry I found you late. You are the channel that offers the best php content I have ever seen.

borakayalar
Автор

These lessons are extremely useful for PHP learners. Thanks a million!

Vitalii-mr
Автор

This video lesson requires more viewings. Very well worked.

petruciucur
Автор

Thanks for your hard work. These videos helped me understand better a lot of things.

MrWhy
Автор

Thanks for sharing your knowledge. This is without a doubt one of the best, if not the best PHP channel out there.

CarlosAndresAristizabal-ds
Автор

Two minutes in and I've learned something new. Thanks for the video!

BrenIrwin
Автор

brother u do magic with this course, really thank u and please continue for projects
love ur way on explanation really u are awesome

TechFutureFocus
Автор

im already starting to get my hand on experience and caching up on PHP and this is only tutorial 25 I can only wonder what finishing the entire course will teach me! thank you for making this amazing PHP 8 tutorial

Jam-htky
Автор

Yet another very thorough and comprehensive explanation. Thanks so much! And I agree with the other commenters. Your course is far and away better than any paid course I have looked at.
One question though, at timestamp 6:50, using your code example, I get the expected output array values, plus the number 1 at the end:

$array = [1, 2, 3, 4];
$array2 = array_map(function($number) {
return $number * $number;
}, $array);

echo '<pre>';
echo print_r($array2);
echo '</pre>';

OUTPUT:
Array
(
[0] => 1
[1] => 4
[2] => 9
[3] => 16
)
1 <- any idea why 1 is also being returned? I'm using PHP 8.1, not sure that makes a difference .

lotuslando
Автор

Thank you for sharing your valuable knowledge with us!

ahmedmahdy
Автор

Another Perfection by you Gio.Thank you

Armando-pxhi
Автор

Hello Gio! Great tutorial. Thanks for making available this course. Just an observation I could realize about arrow functions: we can modify the variables from the parent scope by using the superglobal $GLOBALS. For instance:
$x = 5;
$array = [1, 2, 3, 4, 5];
$result = array_map(fn($number) => $number * $GLOBALS['x']++, $array);

var_dump($x); // It prints int(10)

cininformatica
Автор

Thank you man, I get a lot of new information!

andrewsokolovsky
Автор

I will thumb up all your tutorials, thank you sir.

jessieren
Автор

That's so cool!
$sum = function(callable $callback, int|float ...$numbers): int|float{
return
};
echo $sum ('foo', 1, 2, 3);
function foo($element){
return $element *2;
}

jessieren
Автор

A loved this content! Thanks for share Gio!

TioJobs