PHP Traits - How They Work & Drawbacks - Full PHP 8 Tutorial

Описание к видео PHP Traits - How They Work & Drawbacks - Full PHP 8 Tutorial

In this video, you will learn all you need to know about traits in PHP with examples & in-depth explanations. You'll learn what problems traits solve as well as the problems it can introduce.

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
⭐ Become a Patreon:   / programwithgio  
THANK YOU!

LESSON 2.14
Course Outline - https://github.com/ggelashvili/learnp...
Course Playlist -    • Learn PHP The Right Way - Full PHP Tu...  

RESOURCES
https://www.php.net/manual/en/languag...

CHAPTERS
00:00 - Intro
00:27 - Multiple inheritance problem
02:02 - Overview of coffee maker example in code
03:08 - Using interfaces instead of multiple inheritance
05:43 - Creating & using traits
08:22 - How do traits work?
08:39 - Method precedence
11:02 - Conflict resolution ("insteadof" & "as" operators)
13:38 - Changing visibility of trait methods
16:02 - Composing traits from other traits
16:46 - Properties within traits
20:40 - Abstract methods in traits
23:19 - Static properties & methods in traits
25:38 - Magic _CLASS_ constant in traits
26:13 - Personal opinion & downsides of traits
28:46 - Example comparing inheritance & traits

Комментарии

Информация по комментариям в разработке