Covariance & Contravariance in PHP - Full PHP 8 Tutorial

preview_player
Показать описание
Covariant & Contravariant types are the topic that boggles our minds sometimes. In this video, I try to explain it in more detail the way I wish someone explained it to me when I was learning it because this is one of the topics that was somewhat difficult to grasp in the beginning.

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!

🛠️ TOOLS & SERVICES I USE

COURSE PLAYLIST

RESOURCES

TABLE OF CONTENTS
00:00 - Covariant & Contravariant Types
01:40 - Return Type Covariance Example
04:38 - Paramter Type Contravariance Example
06:39 - Testing Covariance & Contravariance In PHP 7.3
08:06 - Covariant Parameter & Contravariant Return Type Support?
10:16 - Covariance & Contravariance With Union & Intersection Types
11:48 - Liskov Substitution Principle (LSP)

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
Рекомендации по теме
Комментарии
Автор

I have been watching these series of videos since the beginning and there are lots of new things I learned as a senior PHP developer. Thank you so much for such a great job!!!
I am leaving a comment here because I really would like to see SOLID principles explained by you. If that is possible, please do.

papinzazyan
Автор

Thank you for this one! Video about SOLID principles would be great...

vitaliksw
Автор

Yes, videos about SOLID would be great, there are a lot with examples and exercises to do in JAVA JAVA). Design Patterns after that also would be awesome.

guillermofernandez
Автор

I've commented a couple of times here and on Twitter! You're a legend! Please make a video series on SOLID too—no one seems to have asked for it, but that's their loss for sure (though I didn't check, to be honest)! I saw your video series on Laravel and I was like, 😁😁

mehdi-vlnn
Автор

The names seemed scary lol but you explained the principles so well Gio. Watched it twice already. They are straight forward. These series are exposing me to a lot or php features and programing principles too. This course is a literal answer to prayer I must confess. Thanks Gio.

Zubbee
Автор

Thank you gio. Interested in the SOLID principles explanation

emekatimothyiloba
Автор

yes. please make separate video on SOLID principles

lalithhakari
Автор

Thanks for the helpful and informative video! A video about SOLID principles with such good examples would be great too 😉!

yuriymiroshnychenko
Автор

Another wonderful video about PHP thing that I have not noticed anywhere else. Just wanted to let you know that the appearence when you added Note, Summary, Remember parts it was so nice and helpful I have added all the Summary thing on my notebook so that when I read about Covaiance and Contravariance I can remember what you told. That's some improvement that I needed. Thanks a lot :)

Armando-pxhi
Автор

welcome back, PHP the right way, thank you so much

momohhassan
Автор

Great lesson as always 👍👍👍. At first it wasn't clear for me why return type covariance doesn't break the lsp, but after making a few examples with covariance myself and unsuccessfuly trying to break the code it perfectly makes sence now.

aleksandrkanygin
Автор

Well I got confuse at first for contravairance why they making it a vice versa of covariance return type and then I realized at the end of the video when you explained about Liskov Substitution Principle that children class must have a general parameter type so we can pass any type of class less specific to the base parameter type. Thanks Gio.

stephen.cabreros
Автор

Yes sir, we want SOLID principles playlist, it's necessary for us, also design patterns using PHP. would make sense. Waiting for that course, sir.

expresscoding
Автор

Great! I love your explanations and the fact that you raise interesting topics. More advanced PHP please :D

alexios
Автор

Thank you and I would appreciate a video series on the solid principles.

memack
Автор

you are a god's sent, Keep it up. You deserve every bit of recognition

leeroy
Автор

another great content;
the new animation super cool😁

mwaas
Автор

Great explanation, please consider to add SOLID tutorials

santvar
Автор

i would like a series on the solid principles

josephadorboe
Автор

Thanks for the lesson, we've missed u already

mamdouhzaq