Inheritance for beginners - OOP in PHP | Part 6

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • The following video explains what is inheritance and how to use it in PHP.
    Classes, properties and methods:
    • Creating classes, prop...
    Class constants:
    • Class Constants in PHP...
    Follow me on social media:
    / thecodeholic
    / thecodeholic
    github.com/the...

КОМЕНТАРІ • 12

  • @yuriiyakhnytsia2292
    @yuriiyakhnytsia2292 Рік тому

    Really good job, especially if you need to learn PHP in a few days, after the fifth video my mind is blowing, but it's pretty common to Java, just need to get used to the syntax, and some major differences.
    I hope the guy who will work on the project after me will never know me and where I live.

  • @NicoILeone
    @NicoILeone 5 років тому +4

    Excellent! It is good to refresh language skills! Regards!

  • @GlaucoHass
    @GlaucoHass 3 роки тому +3

    lol at the full screen face love declaration 😂

  • @habibulislam152
    @habibulislam152 3 роки тому +1

    8:15 why it is self:: instead of parent:: ???

  • @adilrabid6422
    @adilrabid6422 3 роки тому +1

    Did'm understood the line - parent::__construct($name, $age, $phone)
    is it for inheriting parent class constructor function?
    thank you!

    • @nazimnizarali4070
      @nazimnizarali4070 3 роки тому +2

      Calling parent constructor method is to avoid code duplication. Because 3 properties are already set in parent's constructor method so instead of writing the code again in child class, we can simply call parent constructor in child's constructor method.

  • @rahilarious
    @rahilarious 4 роки тому +2

    Sir you type so damn fast. Can make a video on that? xD do typeracer challenge and share tips on improving speed.

  • @SPOKOZE2
    @SPOKOZE2 3 роки тому

    Hello! Good job your videos, I saw 5 hour php... few days ago and now watch this course :)
    2:00 to get private property of course I should create method in Parent class but to get protected property can I create this metod in Child class? Do I understand correctly? Is there small inaccuracy in your video...?:)

    • @SPOKOZE2
      @SPOKOZE2 3 роки тому

      And next I am going to watch PHP MVC Framework, I always wanted understand how it is work... hehe
      is it good sequence to watch your php wideos?:)

    • @nazimnizarali4070
      @nazimnizarali4070 3 роки тому +1

      To get a PRIVATE property of PARENT class you should create method in PARENT class but to get PROTECTED property of PARENT class you can create method in both PARENT and CHILD class.

  • @Kai-xc7qu
    @Kai-xc7qu 4 місяці тому

    like