PHP Abstract Classes & Methods - Full PHP 8 Tutorial

  Рет қаралды 27,836

Program With Gio

Program With Gio

Күн бұрын

Пікірлер: 102
@junelajambaro9215
@junelajambaro9215 3 жыл бұрын
If I'm not in any rush, I don't skip ads to support your channel. I'm not gonna surprise if this channel will grow more and more in the near future. You're now one of my favorite instructors here in KZbin. :)
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
Thank you so much, happy to hear that & I appreciate the support
@aleksandrkanygin2672
@aleksandrkanygin2672 3 жыл бұрын
Oh my god, completely forgot about ads, from now i'll turn off the adblock for this channel
@sheikh4218
@sheikh4218 Жыл бұрын
I watched many php related courses but without any doubt i want to say that your course is best php course on entire youtube thank you for providing us such a valuable content now i understand much more in oop because of you and i want that you make a course on laravel also i would be very grateful if you did
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thank you 🙏. I plan on making Laravel course, don't have the date yet though
@RushAlvarado
@RushAlvarado 2 жыл бұрын
If I pass the job interview, I'll buy you something. Thank you so much so much for these videos.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
That's very kind of you but you passing the interview will be more than enough for me. Best of luck, I'm sure you'll ace it 🙌
@wesammohammed1819
@wesammohammed1819 15 күн бұрын
"Thank you, my teacher Gio, for your dedication and clarity in teaching. Truly inspiring!"
@ProgramWithGio
@ProgramWithGio 14 күн бұрын
You're welcome, glad you find it helpful
@nataliadrause924
@nataliadrause924 Жыл бұрын
I can't thank you enough for these amazing series! I've been already using so much knowledge from it in my work. Huge thanks!
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Super happy to hear this, thank you & keep on rocking 🙌
@thevipinchand4690
@thevipinchand4690 3 жыл бұрын
Clear explanation. I am learning couple of things from your every videos. Thanks much
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
You're welcome, happy to hear that my videos are helpful 🙌
@Zubbee
@Zubbee 2 жыл бұрын
Great lesson. I'm really counting on more exposure. To really know when to implement abstract classes or not. This is technical stuff man. Thanks Gio
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
With practice & experience you'll know
@federicobau8651
@federicobau8651 3 жыл бұрын
Best php class and oop tutorial
@CodeWithAbirOfficial
@CodeWithAbirOfficial Жыл бұрын
Thank you, @Gio! I now grasp the concept of abstract classes better than I did in college.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
That's great, happy to hear 💙
@peterpardo4138
@peterpardo4138 Жыл бұрын
Thank you for this! Currently watching this course everyday. Again, thank you!
@ProgramWithGio
@ProgramWithGio Жыл бұрын
You're very welcome, thanks for watching
@peterpardo4138
@peterpardo4138 Жыл бұрын
@@ProgramWithGio I remember someone suggesting if you can create a "composer tutorial", and I will gladly support that in case you plan in creating one. Thank you again! I really appreciate it.
@shehiali9889
@shehiali9889 3 жыл бұрын
great tutorial, pls upload more complex OOP PHP features
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
Thank you. We're moving to more complex & advanced PHP with each new lesson 👍
@Vitalii-m6r
@Vitalii-m6r Жыл бұрын
This course is awesome, to say the least. Thanks!
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thank you 💙
@siyahkedilucifer
@siyahkedilucifer Жыл бұрын
Hi, isnt it overloading instead of "overriding" at 7:47? As I know, if you use same method in child class but pass different parameters, its overloading not overriding. But is it different in PHP?
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Hello. PHP does not support method/function overloading. Overloading is when you have 2 functions with same name but different arguments and it gets called based on the arguments passed. When you use inheritance you are overriding the method.
@sujanmiya4514
@sujanmiya4514 2 жыл бұрын
Great tutorial
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you 🙌
@Curiosity-7-
@Curiosity-7- 2 жыл бұрын
Hi sir everything is just perfect and up to the mark. just one suggestion as most of us make notes it will be very helpful if imp point you mention in between could be available as summary in one frame so that we can take snap of it rather than typing by our self. Again thanks for what u r doing GBU🙂🙏.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Hello. Thank you & I'll try my 💙
@alazark94
@alazark94 2 жыл бұрын
Great one man!!! Really cleared a lot of things for me!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Glad to hear it, thank you
@miroslavtoikin
@miroslavtoikin 2 жыл бұрын
Great PHP tutorial, thank you so much!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you 💙
@CarlosOrtiz-sz2pp
@CarlosOrtiz-sz2pp 2 жыл бұрын
Very interesting lesson, thank you
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Glad you like it, thank you 🙌
@Armando-px8hi
@Armando-px8hi Жыл бұрын
Thank you so much Gio , I said and will keep saying that you are the best who knows everything about PHP. I have one question, is open-closed principle often used in oop or not so?
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thank you. Yes that is one of the principles of OOP in general, not specific to PHP
@josephjohn4810
@josephjohn4810 2 жыл бұрын
why do we need to create instances of Field and Boolean and display them if we don't need them? we can as well ignore creating the instances and display the rest? i need explanation on this, thanks
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Just as an example, if you watch it little bit more we change the Field & Boolean to abstract classes & remove the instantiation part.
@karam0101
@karam0101 2 жыл бұрын
Thank you very much Gio 👍👍👍👍
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome
@agahozoclaire9605
@agahozoclaire9605 Жыл бұрын
can abstract class inherint another class as an abstract ? and another thing you say about override default values the render function in the parent class has argument which is $name.?
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Yes abstract class can extend another class. I don't think I understand the question about default value, can you rephrase?
@omaryahia
@omaryahia Жыл бұрын
amazing as always
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thanks 💙
@codobyte
@codobyte 3 жыл бұрын
When I an trying to use the Property Promotion Attribute PHPStrom 2020.1 throws error: semicolon expected. I have PHP8 installed locally, but can't set PHP language level above 7.4 in PHPStorm Settings. Is there a possiblity to overcome this? Excuse my poor english, I am Dutch :-)
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
PHPStorm 2020.1 does not have support for PHP 8, you will need to update the phpstorm version. It was added I think in 2020.3 or 2021.1
@brainyworld2184
@brainyworld2184 3 жыл бұрын
Thanks, well explained. What is the major difference between Abstract and Interface?
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
Thank you. The next video will be about interfaces & I'll explain the differences. The main difference is that abstract class can have implementations (non-abstract methods) while interface only contains method definitions. The next video will have more details.
@brainyworld2184
@brainyworld2184 3 жыл бұрын
@@ProgramWithGio Once again thanks for the awesome tutorials
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
@@brainyworld2184 you're welcome. I'm glad it's helpful 🙌
@brainyworld2184
@brainyworld2184 3 жыл бұрын
​@@ProgramWithGio Your clear explanation of basic concepts keep me coming for your tutorials
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
@@brainyworld2184 Very happy to hear that. Those basic & small details are pretty important :)
@eduardozinhani2056
@eduardozinhani2056 2 жыл бұрын
Please turn on subtitles! thanks for the tutorials
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Subtitles are on, it's just sometimes KZbin doesn't generate them on some videos.
@johongirrahimov2343
@johongirrahimov2343 3 жыл бұрын
***SUMMARY*** - Abstract class is the class that has at least one an abstract method - Abstract class does just declare the abstract method but does not implement it. In other terms, it knows what of the abstract method but not how of the abstract method - Child class method knows how the abstract method - Rule for using the abstract method: -. The signature of the abstract method and child class method must be the same however the abstract method can have additional arguments.
@faramarztayyari3734
@faramarztayyari3734 3 жыл бұрын
I will add : - Abstract class can have both abstract method and normal method
@abdussukkur9080
@abdussukkur9080 3 жыл бұрын
- Abstract method can't declare as private
@godmansarah
@godmansarah 2 жыл бұрын
- The abstract method can have additional arguments so long as they have default values.
@oghenevwefepeace2501
@oghenevwefepeace2501 2 жыл бұрын
abstract classes can implement static methods
@ינוןאלבז-כ1ז
@ינוןאלבז-כ1ז 2 жыл бұрын
I think that abstract class can also be used as a kind of documentation that is embedded directly in the code instead of writing it as comments on the code
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Hmm, not exactly sure what you mean
@ינוןאלבז-כ1ז
@ינוןאלבז-כ1ז 2 жыл бұрын
@@ProgramWithGio I mean that if another developer sees the code, he can, according to the abstract class, understand how the rest of the code is structured and what it means
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
@@ינוןאלבז-כ1ז I don't see that as a good usecase to be honest. If you want to enforce something you can use interfaces to set a contract. Abstract class shouldn't replace a documentation then it just adds extra class for no apparent reason. Maybe I'm missing something.
@donmikele07
@donmikele07 Жыл бұрын
When to use abstract classes and when interfaces?
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Next video is about interfaces and that should help answer that question. In general if you need polymorphism you would use interfaces. Abstract classes for inheritance if you need to build a hierarchy in a way
@donmikele07
@donmikele07 Жыл бұрын
@@ProgramWithGio Thank you! Clear answer!
@truthteachers
@truthteachers 2 жыл бұрын
Hi Bro, I am still having problems with your code samples. In the previous lesson the src folder and this lesson is different. So i follow and override the old src folder. That is ok, if and only if you dont go back to the older contents at some point in another video. In some cases you do that and I had to scramble to create the old codes. I hope its going to happen again.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Some lessons don't have source code like this one. If the lesson is mostly theory then it doesn't have branch in the repository. Ones that do you will find the link in the description to the specific branch. Most lessons in 1st & 2nd sections don't have associated branches. You can always DM me on Twitter and I'll be happy to help you & clear up any confusion 👍
@truthteachers
@truthteachers 2 жыл бұрын
@@ProgramWithGio That is what I decided. Done testing code. Just watch n move on. Less leg work.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
@@truthteachers yea, third section is where you'll need to code along and there are branches & source for them available.
@rustem6388
@rustem6388 Жыл бұрын
Thank you!!!🙏
@ProgramWithGio
@ProgramWithGio Жыл бұрын
You are welcome 🙌
@hasanablak
@hasanablak 4 күн бұрын
thanks
@ilya_123__
@ilya_123__ Жыл бұрын
thank you!
@ProgramWithGio
@ProgramWithGio Жыл бұрын
You're welcome
@rosarioveneruso9928
@rosarioveneruso9928 3 жыл бұрын
Hi Gio , could u turn on the subtitles for this video?
@rosarioveneruso9928
@rosarioveneruso9928 3 жыл бұрын
Also , did you mention the heredoc html syntax in previous videos?
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
It should be automatic, I'll check what's up with this video, maybe KZbin wasn't able to detect it. There is video about heredoc syntax in first section of the course together with string data type
@rxxt-sh1vj
@rxxt-sh1vj 3 жыл бұрын
Bro is it necessary that an abstract class should have atleast one abstract method ??
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
No, you can have abstract class without abstract methods. It's just if you have at least one abstract method then class has to be abstract also.
@rxxt-sh1vj
@rxxt-sh1vj 3 жыл бұрын
@@ProgramWithGio Sounds Nice :D
@memack101
@memack101 2 жыл бұрын
Thank you.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome!
@EyadJafar
@EyadJafar Жыл бұрын
its a perfect series go ahead do u have any courses on udemy u the best
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thank you. No, I don't have courses on Udemy
@techatival
@techatival 3 жыл бұрын
Thanks again! Oh, it looks like i am the first commenter.
@ProgramWithGio
@ProgramWithGio 3 жыл бұрын
You're welcome :)
@Davorge
@Davorge 2 жыл бұрын
Gio is so blazing fast that watching in 0.85 feels like a must 😂
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
😂😂. I'm so sorry haha. I've made mistakes while editing. I am usually fast while talking but I also cut out empty spaces while editing making it seem like I don't breathe 😁
@Netpilation
@Netpilation 7 ай бұрын
this is some nect level stuff
@ProgramWithGio
@ProgramWithGio 5 ай бұрын
Glad you like it
@lairotuT-Tutorial
@lairotuT-Tutorial 3 ай бұрын
Great!!! But I don't understand why in your example we could not simply make the rendering more flexible to be used on every of the childs to reduce duplication. public function renderField($type, $name) { return
@ProgramWithGio
@ProgramWithGio 3 ай бұрын
You could but then what if you have Select or other type of fields that are not . You'd have to override the method. So another way would be to have InputField as base class which has the render method with and then rest of the input type fields would extend this. Select field would extend the base field class & have its own render.
@lairotuT-Tutorial
@lairotuT-Tutorial 3 ай бұрын
@@ProgramWithGio Yeah, that sounds clear to me. Indeed that is a bit what I meant. For me it sounds great to get rid of as many HTML-stuff and build my page with PHP-objects but is this really usually done or is it only a kind of playground?
@ProgramWithGio
@ProgramWithGio 3 ай бұрын
It depends, if you are building some kind of library or a toolkit then maybe. I personally try to keep the UI components inside front-end & avoid using PHP for it unless I need some dynamic generation, even then I try to create an API for it so that I can pass info from PHP to view & have the view generate the proper html component
@illegalsmirf
@illegalsmirf Жыл бұрын
The more abstract OOP gets, the dumber I feel 😵‍💫
@ProgramWithGio
@ProgramWithGio Жыл бұрын
I feel you. I've felt the same way when I was starting out, so don't worry about it. Keep practicing & stay consistent and you'll get through it 💪
@dilshan6377
@dilshan6377 9 ай бұрын
start 2024-03-04, today 3-19 still in here i have lot of things to know.
@ProgramWithGio
@ProgramWithGio 9 ай бұрын
Keep going, its not a sprint, its a marathon. Enjoy the process
Abstract Classes and Methods in Java Explained in 7 Minutes
7:00
Coding with John
Рет қаралды 564 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
PHP Traits - How They Work & Drawbacks - Full PHP 8 Tutorial
31:41
Program With Gio
Рет қаралды 34 М.
PHP - Encapsulation & Abstraction -  Full PHP 8 Tutorial
15:23
Program With Gio
Рет қаралды 33 М.
Abstraction Can Make Your Code Worse
5:13
CodeAesthetic
Рет қаралды 677 М.
Python abstract classes 👻
7:45
Bro Code
Рет қаралды 82 М.
When to use Traits, Interfaces, and Abstract Classes in PHP
15:08
Andrew Schmelyun
Рет қаралды 24 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 820 М.
PHP Generators Explained - Full PHP 8 Tutorial
25:47
Program With Gio
Рет қаралды 32 М.
Kerbal Space Program 2 Was Murdered.
11:26
Bellular News
Рет қаралды 428 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН