13: Interfaces in OOP PHP | Interfaces Explained | Object Oriented PHP Tutorial | PHP Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 219

  • @bicanmarianvaleriu5400
    @bicanmarianvaleriu5400 5 ปีที่แล้ว +199

    Awesome effect for typo 😍 - 2:20

  • @kristapsvecvagars5049
    @kristapsvecvagars5049 4 ปีที่แล้ว +192

    You always find ways to make people smile whilst teaching a valuable lesson. That typo fix was simply epic 😁

    • @guscostarock
      @guscostarock 2 ปีที่แล้ว

      🤣 It reminded me of "Toasty" on Mortal Kombat.

    • @astev52
      @astev52 2 ปีที่แล้ว

      That's what I thought, that was funny.

  • @mrpddnos
    @mrpddnos 5 ปีที่แล้ว +39

    Been using php for years. Never understood the whole interface business. Now in 20 minutes understand it and now working on a way how to implement it in my current project (where it will solve quite a few problems).

  • @lpanebr
    @lpanebr ปีที่แล้ว +3

    I never thought of using interfaces for type definition. It's genius. Thank you!

  • @OcenaStrex
    @OcenaStrex 3 ปีที่แล้ว +8

    I've never grasped the need for interfaces. I've always felt that I could simply throw them out and the code would still work. This is the first and best explanation of interfaces I have seen. Finally that light is starting to shine in my head. Thank you very much for this lesson. I will be going over your other tutorials and hopefully implement what I've learned in future projects.

  • @laloptk100
    @laloptk100 4 ปีที่แล้ว +16

    Thanks man. I was failing in understanding why the hell everybody says Interfaces are so powerful and give flexibility to your code. Yeah, they spit those words but they never tell you why, even worst, they just entangle with a lot of technical jargon speaking about things that implement a dependency of an object and blah blah blah (Which can be specially difficult for me because english is my second language and tutorials in spanish are not always very good). Finally someone explain it in plain words, thanks again. I'm guessing this is not the only thing you can do with Interfaces, but I'll keep reasearching and thanks to you I can understand things better now.

  • @debikadminconsult9006
    @debikadminconsult9006 3 ปีที่แล้ว +4

    Sometimes after watching any video, the best way to consolidate the learning process is to peruse the comment section and listen to other people thought patterns. It is very enlightening, and I give kudos to the video creator and awesome commenters in the comment section. Very educative content, and I am really impress. Thank you

  • @raulrojas6552
    @raulrojas6552 2 ปีที่แล้ว +1

    I didn't get it the first time, but now I get it, great!

  • @karljohnhonrado4551
    @karljohnhonrado4551 4 ปีที่แล้ว +7

    This guy explains way way more better than my teacher in college.

  • @RishabKapadia
    @RishabKapadia ปีที่แล้ว

    The best php interface video on youtube. Period. 💯

  • @PorgyGeorgy1
    @PorgyGeorgy1 4 ปีที่แล้ว +6

    You're one of the best teachers. And you're also very likable. Thank you very much for all your hard work. The bell does indeed... light up. 😂👍🏼

  • @trevormoore468
    @trevormoore468 4 ปีที่แล้ว

    your examples are one of the few that actually make sense and click for me, ive watched tons of youtube videos and took alot of online courses and no one comes close to how well you explain things and how well your examples are done and explained

  • @Bonafide188
    @Bonafide188 4 ปีที่แล้ว +3

    This video was pure perfection, thanks so much for the clear explanation about why we use interfaces. I am trying to learn OOP PHP in order to use Laravel and this series is explaining so much

  • @BaneZr994
    @BaneZr994 5 ปีที่แล้ว +6

    Okay, I watched the whole PHP Series, I am so glad I found you! Really good job on explaining everything in such a simple way and showcasing some usages for everything :)!

  • @csandreas1
    @csandreas1 3 ปีที่แล้ว +1

    I don't know why it took 19 minutes. I watched the whole video and it started making sense in the last five minutes

  • @hemantsingh47
    @hemantsingh47 2 ปีที่แล้ว

    Best video to show the real face of an interface use.

  • @tamisweitzer275
    @tamisweitzer275 2 ปีที่แล้ว

    This is the first time someone explained interfaces in a way that made sense. Using payment methods was a perfect example, IMO.

  • @carlosmaralit8784
    @carlosmaralit8784 ปีที่แล้ว +1

    that effect when type hahahahha... very good content, thank you for this tutorials, please continue to create web tutorial, your tutorial are all awesome and helpful

  • @mastammworld
    @mastammworld ปีที่แล้ว

    You did it :)
    I have been watching multiple videos on TH-cam from many so-called tech gurus for the last 2 hours just to understand why should use interface in my code but finally, I got at least one reason from this video.

  • @JeremyMecham
    @JeremyMecham 2 ปีที่แล้ว

    The most thorough explanations of PHP OOP that I have found yet! Thank you so much. (subscribed)👍

  • @slimyelow
    @slimyelow 3 ปีที่แล้ว +3

    I am having so much fun watching this and matching it to a Laravel project I have been working on and stuff is finally starting to click for real. This is after I thought I knew it all !@@! Great Great Video !!!!! - as always by Dani

  • @oanacristea2572
    @oanacristea2572 3 ปีที่แล้ว +1

    Well done for your work!! 👏 Honestly, the best explanation I could see/hear so far. Finally, I found someone to explains interfaces the right way: What are the interfaces? Where to use them? and Why we use them?. Thank you, Dani!!!!! Keep up the good work! 💯

  • @BillClinton228
    @BillClinton228 4 ปีที่แล้ว +1

    Thank you, I could never understand Interfaces until now. To simplify I would just say it's a good way of implementing inheritance for multiple classes, usually you can only inherit one class at a time.

  • @ShawnRitch
    @ShawnRitch 5 ปีที่แล้ว +5

    This might be exactly what I have been looking for to run a content management system I'm developing. Thank you sir - you da BOMB!!!

    • @rodgerspenda3207
      @rodgerspenda3207 3 ปีที่แล้ว

      bro share the link to your cms. we might a build a plugin for it😂😂

  • @LiteralHatReloaded
    @LiteralHatReloaded 5 หลายเดือนก่อน

    oh my GOD MY MIND IS BLOWN THANK YOU

  • @JoshuaTMagee
    @JoshuaTMagee 5 ปีที่แล้ว +9

    I feel like we took a huge jump in complexity between episode 11 and this one, haha. Struggling to keep up, but thank you so much for everything you're doing with this channel!

    • @nvmffs
      @nvmffs 4 ปีที่แล้ว

      Scope resolution was a jump too?

    • @marco114
      @marco114 4 ปีที่แล้ว +1

      i agree. feel like he just left me in the dust

    • @tiagomota4734
      @tiagomota4734 ปีที่แล้ว

      did you managed to do it ? im extremly new and it seems like ...oh well impossible?

    • @jonsdogg2400
      @jonsdogg2400 ปีที่แล้ว

      ​@@tiagomota4734​ which one? are you referring to scope resolution or interface?

    • @Michael-lo3ht
      @Michael-lo3ht 9 หลายเดือนก่อน

      I agree somewhat. I think it started out great, and a useful feature. But then I know it had too many twists and turns that my eyes glazed over. I may have to watch it again, but stop before it gets too far and just absorb that first. I'm hooked on his videos.

  • @ollaray1
    @ollaray1 4 ปีที่แล้ว +50

    I think the paymentProcess() should also be defined in the PaymentInterface interface else the entire code is gonna generate an error while trying to look for it in the BuyProduct Class

    • @klarisa1784
      @klarisa1784 2 ปีที่แล้ว +1

      i thought just like u , but when i tried it in vsc it functions and doesnt show any error

    • @tiagomota4734
      @tiagomota4734 ปีที่แล้ว +1

      as a beginer i understand ZERO from this tutorial, it seems a little bit like rocket science at least, if not extraterestrial communication with earth! I really really wonder how much time it will take to actually be able to implement this by myself, i guess 10 to 20 years!

    • @ulijibkadelm318
      @ulijibkadelm318 ปีที่แล้ว +2

      @@tiagomota4734 exactly me 2 days ago, take a note and break things down to pieces of information on how the flow of the code. You'll get it eventually.

  • @fury_uri
    @fury_uri 2 ปีที่แล้ว +1

    Well done! You made the topic easy to see and understand. Thank you!

  • @Gamer-gp3id
    @Gamer-gp3id 2 ปีที่แล้ว

    You are so funny🤣you always make people smile. 😁That's why your tutorials so interesting😊. Thank you very much for your hard work😉👏👏👏

  • @sashetrajkovski6006
    @sashetrajkovski6006 3 ปีที่แล้ว

    i love you man, i love you, i can now say that i know what are interfaces and why are they used for , after watching 10 videos minimum and reading million articles on this subject i didn't know the actual implementation. Plus that useful dependency injection tip is just magic so useful. THANK YOU MAN !!!!

  • @localLyricsPh
    @localLyricsPh ปีที่แล้ว

    I repeat this ep. 4 time to really understand the concept. Thanksss again dani !! 🥰🥰

  • @samduss4193
    @samduss4193 2 ปีที่แล้ว +1

    This exemple is good cause it is very concrete kind of when it is used... the only more complicated understanding is calling an object into a Class which is mind blowing.... that is what i notice :)

  • @harrisonoluchukwuebuka3646
    @harrisonoluchukwuebuka3646 4 ปีที่แล้ว

    best explanation of interface i have ever seen. finally i understood what interface mean. thanks man. i appreciate

  • @lambertotamayo4320
    @lambertotamayo4320 4 ปีที่แล้ว +1

    i'm new to learn oop, and now i understand how it works by watching your tutorial. thanks a lot sir. hope theres a tutorial for using this oop for a simple website sir.

  • @oanacristea2572
    @oanacristea2572 3 ปีที่แล้ว

    And btw. I really like the dark theme. I usually watch video during the evening, so much nicer for the eyes. 👀🕶

  • @Infinitesap
    @Infinitesap 2 ปีที่แล้ว

    Extremely well done explanation! I really appreciate your style - showing / explaining while the classes are created an evolves into implementing the interfaces
    Never saw/heard a better explanation.
    13 on a 10 scale!

  • @Vendubak
    @Vendubak 2 ปีที่แล้ว +1

    I like your tutorials. I went through many, really many and find yours the best. Keep going :) And Thanks also for the funny part correcting the typo :D

  • @kriba6755
    @kriba6755 4 ปีที่แล้ว

    Best explanation of interfaces. I have tried to understand the use of them for some time. But this made it crystal clear

  • @dante_wat1733
    @dante_wat1733 2 ปีที่แล้ว

    damn it finally makes sense. I've read about interfaces before but I've never really got why and how they can be used. now i understand. thank you

  • @dhruvkumar-br2lp
    @dhruvkumar-br2lp 11 หลายเดือนก่อน

    Best video i ever saw on interface

  • @rxjahid9404
    @rxjahid9404 3 ปีที่แล้ว

    love from Bangladesh ,your video helped me a lot.

  • @blanche0018
    @blanche0018 3 ปีที่แล้ว

    this is the third time I'm watching this xD finally, I understand it!...maybe a bit..I'll try to practice it as well. Thank you so much for your tutorials, I've been following it since last week T-T

  • @MrRvalentin
    @MrRvalentin 2 ปีที่แล้ว

    Need same IDE to corect my typos !!! Awesome teachings !

  • @muzika5001
    @muzika5001 2 ปีที่แล้ว

    After watching two times it is clear now. 😁

  • @Gamer-gp3id
    @Gamer-gp3id 2 ปีที่แล้ว

    Thanks bro😁I have watched fully 4 times this video😂and I finally understood what do we need interfaces😂😂

  • @harisurrahman3329
    @harisurrahman3329 4 ปีที่แล้ว

    The Best interface explanation

  • @desertmoon_cho322
    @desertmoon_cho322 4 ปีที่แล้ว

    I like how you corrected your typo amazing editing skills, great tutorial by the way.

  • @portermitra7953
    @portermitra7953 4 ปีที่แล้ว

    You are an amazing teacher

  • @webtpoint8009
    @webtpoint8009 4 ปีที่แล้ว

    You make the programming so easy by the awesoeme explanation thank u so much for the video

  • @naimchowdhury5427
    @naimchowdhury5427 4 ปีที่แล้ว

    Thank you for making tutorials that are so easy to understand❤️ !

  • @olis936
    @olis936 4 ปีที่แล้ว

    Thank you very much for doing this video! Good job, i also understand now what is an interface in php und what is for. You have a very pleasure way to teaching that stuff! Thx
    And "Schöne Grüße aus Deutschland"

  • @Meeshalkumar
    @Meeshalkumar 3 ปีที่แล้ว

    Wow, I didn't think someone came make so simple concept so confusing.
    You create an interface in order to implement classes based on that interface, and these classes performs same tasks with slightly different parameters or in different ways.
    For example: you'll create an interface with for payment, with multiple payment methods, and one method which handles the actual payment. Then in the class where you implement it, you'll just refer the method which handles the payment with required parameters.
    This helps organising your code base and implement new payment methods via the interface.

  • @tryharder927
    @tryharder927 5 ปีที่แล้ว

    thanks for uploading new videos , please don't stop , i'm watching all of it
    and i want more

  • @cazpfitl
    @cazpfitl 4 ปีที่แล้ว

    ok, this was hard, but thank you! now its more clear, this will be very usefull!

  • @stephencopeland3908
    @stephencopeland3908 4 ปีที่แล้ว

    you're a great teacher!

  • @gauravpal2854
    @gauravpal2854 ปีที่แล้ว

    Well explained.

  • @CACAMAKAify
    @CACAMAKAify 4 ปีที่แล้ว

    The best example for interfaces on youtube!

  • @mhc4124
    @mhc4124 4 ปีที่แล้ว

    Fantastic explanation.

  • @programmingtestsandproje
    @programmingtestsandproje 3 ปีที่แล้ว

    it was very clear thank you so much

  • @rimantasdanilevicius6754
    @rimantasdanilevicius6754 3 ปีที่แล้ว

    I really liked that interaction 2:30 :D p.s thanks for explaining!

  • @goodjob7782
    @goodjob7782 3 หลายเดือนก่อน

    now you are on the right side :}

  • @thegentofculture
    @thegentofculture 4 ปีที่แล้ว

    You're awesome. Thanks for the explanation.

  • @manuelgmra
    @manuelgmra 4 ปีที่แล้ว

    Thanks a lot
    I have seen another video and this shows me a complement idea about interfaces

  • @ashweenisingh900
    @ashweenisingh900 4 ปีที่แล้ว

    Great explanation, Thank you

  • @ahgiynq
    @ahgiynq 3 ปีที่แล้ว

    The bit u showed up on the left was hilarious :)

  • @mlondimchunu5975
    @mlondimchunu5975 5 หลายเดือนก่อน

    Thanks Dani.

  • @zaimcodes
    @zaimcodes ปีที่แล้ว +1

    I think it is better to include the login process inside the payNow() method in both Visa and Paypal classes...
    Interfaces, as the word suggest, only show us the frontier of the function and it doesn't need to understand what and how payNow() would process the request. Adding the login logics into the payNow() method would save you even more unnecessary complexities (more lines of code, another interface [LoginInterface], another method [paymentProcess] in PaymentInterface)

    • @clementoseiasante6315
      @clementoseiasante6315 6 หลายเดือนก่อน

      True.
      I'm very happy with the way he explained it. I haven't really understood interfaces till now. But i don't get why the paymentProcess() wasn't included in the Payment interface but it was implemented in all the classes that extended that interface. care to explain that ?

  • @henriicker
    @henriicker 4 ปีที่แล้ว

    Thanks for share your knowledge!

  • @nielsofficeofficial9706
    @nielsofficeofficial9706 2 ปีที่แล้ว

    Thanks this is very helpful tutorial Very satisfied. :))

  • @enes1565
    @enes1565 3 ปีที่แล้ว

    you are the effect meister

  • @microcreditocalculod6959
    @microcreditocalculod6959 3 ปีที่แล้ว

    thank you so much, very clear congratulation;

  • @imran_ashraf
    @imran_ashraf 3 หลายเดือนก่อน

    Awesome Tutorial! Can you please do one on PHP Traits?

  • @dennisvantol9754
    @dennisvantol9754 ปีที่แล้ว

    Thank you! Very helpfull 😁👍🏻

  • @perturb7744
    @perturb7744 4 ปีที่แล้ว

    that outro gets me every time.

  • @DjediMind
    @DjediMind 2 ปีที่แล้ว

    THank you, Sir.

  • @MiKo-iz7tt
    @MiKo-iz7tt ปีที่แล้ว +3

    Hi again, there is an inconsistence in the code that I think everybody should be watch.
    In the class BuyProduct, we are defining an interface to get recieved, then, we are accessing to a method that not exists, in this case I'm talking about paymentProcess() which is not defined in the PaymentInterface, when we are passing a "Cash" object at the BuyProduct's instance.

    • @theworldismine7788
      @theworldismine7788 ปีที่แล้ว +1

      yes I write the exact same code as he wrote and I get an error in the paymentProcess method
      What's your solution?

    • @theworldismine7788
      @theworldismine7788 ปีที่แล้ว +1

      I guess bcuz php got updated maybe

  • @MrErkan1969
    @MrErkan1969 4 ปีที่แล้ว

    Great tutorial!!

  • @ivnstudios6135
    @ivnstudios6135 4 ปีที่แล้ว

    perfect , like the episode

  • @_rachid
    @_rachid ปีที่แล้ว +1

    Merci !

  • @hassanfarooq7379
    @hassanfarooq7379 2 ปีที่แล้ว

    Thank you Dani, I am not seeing Dependency Injection video in this series... Maybe you have explained in a different series?

  • @AbhimanyuNaikareWebDeveloper
    @AbhimanyuNaikareWebDeveloper 2 หลายเดือนก่อน

    super exp[lained. thanks

  • @abdessamadelidrissi5884
    @abdessamadelidrissi5884 4 ปีที่แล้ว

    thank you very much

  • @thanhphuongphan4155
    @thanhphuongphan4155 4 ปีที่แล้ว +4

    Great job man. But I could not understand one thing:
    In the Class "BuyProduct", we are trying to use the mutual method "paymentProcess". However, the "PaymentInterface" does not contain the rule of that. It does not throw any error message though. Could you help to explain a little bit on that?

    • @MuhammadAli-ve7mt
      @MuhammadAli-ve7mt 2 ปีที่แล้ว +2

      I don't really think you need an answer anymore but (if someone else might have this confusion) it's because we are receiving the object of one of the classes and using that object to access "paymentProcess()". All the classes do contain paymentProcess so it works, even though the interface doesn't specify that rule.
      The classes can possibly contain other methods along with the specified ones (which are required).

  • @johndoethethird
    @johndoethethird 5 ปีที่แล้ว +1

    My bells are fully lit right now.

  • @Vboystaskandfun
    @Vboystaskandfun 5 ปีที่แล้ว +5

    Pls upload laravel tutorial

  • @codobyte
    @codobyte 5 ปีที่แล้ว +11

    Q: Why not set paymentProcess in the interfaces instead of payNow?

    • @davidjimeneztorrealba5830
      @davidjimeneztorrealba5830 4 ปีที่แล้ว +4

      I think he only wanted to demonstrate that you can also implement multiple interfaces.

    • @williamalesna5703
      @williamalesna5703 4 ปีที่แล้ว +1

      @@davidjimeneztorrealba5830 yes for basic purposes and especially for beginners..

    • @Emassieu
      @Emassieu 4 ปีที่แล้ว +1

      you muss declare both payNow() and paymentProcess()in the interface , because those methods should be declared in all the classes that implements the interface.

    • @tictac1020
      @tictac1020 4 ปีที่แล้ว

      Ha, this was my question as soon as he started writing the second interface. Still processing but to my mind atm, since not all of the classes that implement the paymentProcess interface also have the loginFirst method, you'd still have to abstract up a layer anyway. I guess you could do it at least two different ways.

    • @dfordemo981
      @dfordemo981 3 ปีที่แล้ว

      same question, i am using phpstorm and i was writing the code along with Danni___

  • @saadaqnuurgeedi7777
    @saadaqnuurgeedi7777 2 ปีที่แล้ว

    big light went off in my head!

  • @dhruvkumar-br2lp
    @dhruvkumar-br2lp ปีที่แล้ว

    thank you

  • @atccompany1937
    @atccompany1937 5 ปีที่แล้ว +2

    hello, may I ask two questions please:
    1. why you don't create one interface like PaymentInterface and inserted (public function paymentProcess(); ) method inside it?
    2. when you create a second interface called (LoginInterface) why you didn't add it to the BuyProduct claas function (pay() ) ??

  • @vanhelsingx69x
    @vanhelsingx69x ปีที่แล้ว

    bro that edit is insane, I almost s*it my pants for a few seconds

  • @blessedwarrior1
    @blessedwarrior1 4 ปีที่แล้ว

    AMAZING

  • @Mercio2
    @Mercio2 4 ปีที่แล้ว

    great!

  • @engrmamun59
    @engrmamun59 3 ปีที่แล้ว

    Every tutorials should to make with code execution output in browser !

  • @Happystoreup
    @Happystoreup 5 ปีที่แล้ว

    Thank you!

  • @ajayidhikrullah9125
    @ajayidhikrullah9125 5 ปีที่แล้ว +2

    Assalam Alaykum< God bless you Brother MMTUTS
    really understanding your method of teaching us
    But please, Kindly help separate PHP OOP ffrom that of ther course.
    I mean separate them and use Numbers for users to be able to download easily.
    thank you SIR

  • @urbashikhatiwada8748
    @urbashikhatiwada8748 4 ปีที่แล้ว

    Please make video on iterators and generators in php and real life use cases, closures in php, also A real life OOP Project like: POS system would be a great help to learn.

  • @prabu2778
    @prabu2778 4 ปีที่แล้ว +1

    My mind voice : Hey you want to watch theses playlist one more time to understand😁

  • @Ralyns
    @Ralyns 3 ปีที่แล้ว

    The note that you show at the end is great; however, it's no longer on the php manual page.

  • @favour5442
    @favour5442 2 ปีที่แล้ว

    When Daniel krossing was still Daniel krossing ♥️♥️

  • @TechiePress
    @TechiePress 3 ปีที่แล้ว

    This has been very helpful. Coming from typescript. Can I ask about traits? Can you make something about this?